pyxfem.core.function_spaces module
Created on Mon Dec 4 23:30:08 2023
@author: nchevaug
- class pyxfem.core.function_spaces.DofManagerBase[source]
Bases:
ABCBase class to help manage degree of freedoms
- edge2edgeid(e2v, getxy=False)[source]
from edge defined by there vertices id, recover the edgeid as seen by the space
- class pyxfem.core.function_spaces.FEMSpaceP1(name: str, mesh: SMesh, vecdim: int = 1, tris_map: None | MappingT3 = None)[source]
Bases:
objectClassical Linear Finite Element space
- dNdu = array([[-1., 1., 0.], [-1., 0., 1.]])
- edge2edgeid(e2v, getxy=False)[source]
from edge defined by there vertices id, recover the edgeid as seen by the space
- edgeid2dofid(edges)[source]
from edge id recover the associated dofid For FEMSpaceP1, return an empty array
- get_tris_mapping()[source]
return the (linear mapping (see mapping.MappingT3)) of the mesh entities
- interpolatoryAt = 'vertex'
- lenN = 3
- operator_dof2grad_tri(evaltrisuv, rmap=None, frmap=None, only_on=None, raw_data=False, limited=False)[source]
Return operator dNdx that map the dof value to the gradient of field values at each point uv for each triangle
- operator_dof2val_edge(eids, evaledge_s=array([0.5]))[source]
Return operator N that map the dof value to the field values at each point s of each edge
- class pyxfem.core.function_spaces.FEMSpaceP1NC(name, mesh: SMesh, vecdim=1, tris_map=None)[source]
Bases:
objectImplementation of cruzeix-raviart Element
- dNdu = array([[ 0., 2., -2.], [-2., 2., 0.]])
- edge2edgeid(e2v, getxy=False)[source]
from edge defined by there vertices id, recover the edgeid as seen by the space
- get_tris_mapping()[source]
return the (linear mapping (see mapping.MappingT3)) of the mesh entities
- interpolate(f) NDArray[float64][source]
Compute values of u dofs so that Ni*ui is equal to f at mid edge
- interpolatoryAt = 'midEdge'
- lenN = 3
- operator_dof2grad_tri(evaltrisuv, rmap=None, frmap=None, only_on=None, raw_data=False, limited=False)[source]
Return operator dNdx that map the dof value to the gradient of field values at each point uv for each triangle
- operator_dof2val_edge(eids, evaledges=array([0.5]))[source]
Return operator N that map the dof value to the field values at each point s of each edge
- operator_dof2val_tri(evaltrisuv, rmap=None, frmap=None, only_on=None, raw_data=False)[source]
Return operator N that map the dof value to the field values at each point uv for each triangle
- operator_edgetrace(quad_edges)[source]
return a linear sparse operator N that compute the trace on each edge at points quad_edges from the dof values. t = N@U is an np.array for size nedge*npt*vecdim*2 (it that order) the entries i,j k of t.reshape((nedge, npt, vecdim, 2)) contain the 2 value at edge i, point j, direction k, which correspond to the values at left and right of the edge (we assume here a 2d manifold)
- class pyxfem.core.function_spaces.Heaviside(name, mesh_cut_data, ls_tris, ls_tris_cut)[source]
Bases:
objectHeaviside shape function defined on a cut mesh
- class pyxfem.core.function_spaces.LinearScalarField(a=3, b=4)[source]
Bases:
objectA linear field in 2d : u(x,y) = a*x + b*y
- class pyxfem.core.function_spaces.LinearVectorField[source]
Bases:
objectan example of Vector field for test purpose
- class pyxfem.core.function_spaces.QuadraticScalarField(hess=array([[1., 0.], [0., 1.]]))[source]
Bases:
objectA Quadratic field for example purpose
- class pyxfem.core.function_spaces.QuadraticVectorField[source]
Bases:
objectan example of Vector field for test purpose
- class pyxfem.core.function_spaces.Ridge(name, mesh_cut_data, ls_tris, ls_tris_cut)[source]
Bases:
objectRidge shape function defined on a cut mesh (usefull for discontinuous gradient)
- class pyxfem.core.function_spaces.SomeScalarField(f=1.0)[source]
Bases:
objectan example of scalar field for test purpose
- class pyxfem.core.function_spaces.SomeVectorField(f)[source]
Bases:
objectan example of vector field for test purpose
- class pyxfem.core.function_spaces.SumSpace(list_of_space)[source]
Bases:
objectmake a space as a sum of different space
- class pyxfem.core.function_spaces.TestSparseOp(methodName='runTest')[source]
Bases:
TestCaseClass for unit test of operator on dofs
- class pyxfem.core.function_spaces.VertexSpaceDofManager(m: SMesh, vecdim=3)[source]
Bases:
objectClass to compute the degree of freedom associated to the mesh and the dirichlet BC
- class pyxfem.core.function_spaces.XFEMSpace(name, basespace, enrichment, mesh_cut, ls, ls_cut, rmap=None)[source]
Bases:
objectXFEM Function space : input an enrichment function and a base space and a level set on which the enrichment is defined
- operator_dof2grad_tri(evaltrisuv, rmap=None)[source]
Return operator dNdx that map the dof value to the gradient of field values at each point uv for each triangle
- class pyxfem.core.function_spaces.XRidgeSpaceP1(name, mesh_cut, ls, ls_cut, rmap=None, dosvd=False)[source]
Bases:
objectA special enrichment space for Ridge enrichment
- operator_dof2grad_tri(evaltrisuv, rmap=None)[source]
Return operator dNdx that map the dof value to the gradient of field values at each point uv for each triangle
- pyxfem.core.function_spaces.gradNTri(dNdu, uv, invF)[source]
Compute the gradient with regard to space coordinates xy from gradient with regard to element coordinate uv
- pyxfem.core.function_spaces.meshcutdata2remap_helper(mesh_cut, hmin=0.0, alpha=0.1, p=1)[source]
build a RemapHelper Object from mesh_cut data
- pyxfem.core.function_spaces.op2sparse(NScalar, nscalar_dofs, a2scalardofs, vecdim, nshapeperelem, nptperelem, ndataperpoint, only_on=None)[source]
Given a N array (shape function values at integration point for each element and numbering of degree of freedom dat, construct the sparse N Operator (Assembly)
- pyxfem.core.function_spaces.op2sparse_rmap(NScalar, nscalar_dofs, a2scalardofs, vecdim, nshapeperelem, nptperelem, ndataperpoint, rmap, frmap=None, sort=True)[source]
Given a N array (shape function values at integration point for each element (or sub element)) and numbering of degree of freedom dat, construct the sparse N Operator (Assembly) Specialized version for the case (typically xfem) where element are cut in sub cell
- pyxfem.core.function_spaces.operator_dof2grad_tri(space, vecdim, geomdim, scalar_space_size, tri2dofs, trimap, evaltrisuv, rmap=None, frmap=None, only_on=None, raw_data=False, limited=False)[source]
helper function : return operator N that map the dof value to the gradient of field values at each point uv for each triangle