pyxfem.core.mesh_simplex_one_level module

Created on Mon Nov 20 16:26:58 2023

@author: nchevaug

class pyxfem.core.mesh_simplex_one_level.DMesh(xy, tris)[source]

Bases: object

A class to represent dynamic simplexes mesh in 2D

class Edge(eid, vertices)[source]

Bases: object

edge object

class Face(fid, edges)[source]

Bases: object

face object

get_vertices()[source]

return the vertices object of the current face

get_vertices_id()[source]

return the vertices id of the current face

class Vertex(vid, xy)[source]

Bases: object

vertex object

static edge_cut_call_back_pass(e, e0, e1)[source]

default edge cut call back

static face_cut_call_back_pass(f, f0, f1)[source]

default face cut call back

static get_common_edge(f0, f1)[source]

return common edge between face f0 and f1 or raise

static get_common_vertex(e0, e1)[source]

return common vertex of eà and e0 raise if none

get_coord_and_connect()[source]

return node coordinate and triangle to vertices connectivity

get_edges()[source]

return all edge to vertices

get_faces()[source]

return all edge 2 faces

get_vertices()[source]

return all vertices coordinates

insert_edge(evertices)[source]

add edge linking the 2 vertices in evertices and retuen the handle to the new edge

insert_face(fedges)[source]

add face linking the 3 edges in fedges and retuen the handle to the new face

insert_vertex(xyz)[source]

add vertex with coordinate xyz in the mesh, return the handle to the new vertex

split_edge(e, xyz, edge_cut_cb=<staticmethod(<function DMesh.edge_cut_call_back_pass>)>, face_cut_cb=<staticmethod(<function DMesh.face_cut_call_back_pass>)>)[source]

split edge e suppose to be part of the mesh, at position xyz

class pyxfem.core.mesh_simplex_one_level.SMesh(xy: NDArray[float64], tris: Annotated[NDArray[int64], 'Shape(N, 3)'])[source]

Bases: object

Class to store and interogate simplexe meshes of Triangles

bound_edges(*, save=True)[source]

return a table containing the edge at the boundary of the mesh

e2t(save=True) → CompressedDataIndex[source]

return e to triangle upward adjacencies

e2v(eids=None, *, save=True)[source]

return the edge 2 vertices table

e2v_coord(eids=None, *, save=True)[source]

return a table containing for each edge the coordinates of it 2 nodes ret[i, j, k] is coordinate k of node j in [0,1] of edge i

ecog(eids=None)[source]

return a table containing the center of gravity of each edge

elength(eids=None, *, save=True)[source]

return a table containing the lenght of each edge

enormal(eids=None, flips=None)[source]

return the normal of the edges

erase_edges_data()[source]

clean up all date related to the edges

find_edgeids(e2v)[source]

return edge ids corresponding to edge defined by there 2 nodes ids

geo_dim()[source]

return the geometric dimension of the mesh. For Now it just check the number of columns of the vertices array self.xy, which can only be 2 for 2 dim mesh

get_edgegroupe(groupename)[source]

For groupe name, find and return the edges id (The global id of edge, not the input order …)

and if the “swap” status of each edge in the form of a pair of 2 arrays

get_edgegroupe_names()[source]

return the list of created edge groupes names

get_trigroupe(groupname)[source]

return an array with all the tri id contained in the group

get_trigroupe_names()[source]

return the list of created tri groupes names

get_vertices_on_edges_groups(edgegroupenames)[source]

return all vertices id on the edge groupe

intern_edges(*, save=True)[source]

return a table containing the internal edge of the mesh: edge that connect ot at least 2 trian gles

nedges(*, save=True)[source]

return the number of edge in the mesh

ntris()[source]

return the number of triangles in the mesh

nv(save=True)[source]

return the number of vertices in the mesh

set_edgegroupe_from_edge2vertex_id(groupename, e2v, warn_existing=True)[source]

set a group of edges in the mesh

set_trigroupe_from_tri_id(groupename, tids, warn_existing=True, check=True)[source]

set a group of tri in the mesh

t2e(*, save=True)[source]

return the tri to edge table

t2e_flip(*, save=True)[source]

return the tri to edge table

t2v()[source]

return the triangle to vertices connectivity

t2v_cog(*, save=True)[source]

return a table containing the center of gravity of each triangle

t2v_coord(fids=None, *, save=True)[source]

return a table containing for each triangle the coordinates of its 3 Nodes ret[i, j, k] is coordinate k of node j in [0,1,2] of element i

update(xy, t2v)[source]

Modify the mesh by changing the node list and the triangle list Old vertices id in groupe2edges_v are supposed to stay same old triangle id in groupe2tris are supposed to stay same

used_v(*, save=True)[source]

return the vertices ids that are used by at least 1 triangle

v2e(save=True) → CompressedDataIndex[source]

return vertex to edge adjacencies

v2t(save=True) → CompressedDataIndex[source]

return vertex to triangle adjacencies

vcoord()[source]

return the table of vertices coordinates

pyxfem.core.mesh_simplex_one_level.gmshmodel2smesh(model_name, edge_group_names=None, tri_group_names=None, dim: Literal[2, 3] = 2)[source]

build a smesh from a gmsh model