pyoomph.meshes.simplemeshes module
- class pyoomph.meshes.simplemeshes.CircularMesh(radius=1, inner_factor=0.4, segments='all', domain_name='domain', outer_interface='circumference', straight_interface_name=None, with_curved_entities=True, internal_straight_names=None)[source]
Bases:
MeshTemplateCreate a circular mesh by separting a filled circle into four segments. The segments can be specified by the
segmentsargument. The mesh is created by connecting the center of the circle with the four corners of the segments. The inner factor specifies the radius of the inner quadratic elements relative to the circle radius. The domain name is given bydomain_nameand the outer interface name can be controlled byouter_interface. The straight interfaces are namedcenter_to_north,center_to_west,center_to_south, andcenter_to_eastby default, but can be remapped by thestraight_interface_nameargument.- Parameters:
radius (
Union[Expression,int,float]) – The radius of the circle.inner_factor (
float) – The factor by which the inner radius of the quadratic elements is smaller than the circle radius.segments (
Union[Literal['all'],List[Literal['NW','NE','SW','SE']]]) – The segments of the circle to be meshed. Can be a list of strings"NW","NE","SW", and"SE"or the string"all".domain_name (
str) – The name of the domain.outer_interface (
str) – The name of the outer interface.straight_interface_name (
Union[str,Dict[str,str],Callable[[str],str],None]) – The name of the straight interfaces. Can be a string, a dictionary mapping the default names to new names, or a callable function that maps the default names to new names.with_curved_entities (
bool) – Whether to create curved entities.internal_straight_names (
Union[str,Dict[str,str],None]) – The name of the internal straight interfaces, i.e. interior interfaces from the four directions to the center. Can be a string or a dictionary mapping the default names to new names.
- class pyoomph.meshes.simplemeshes.LineMesh(N=10, size=1.0, minimum=0.0, name='domain', left_name='left', right_name='right', nodal_dimension=None, periodic=False)[source]
Bases:
MeshTemplateA class representing a line mesh.
- Parameters:
N (
int) – The number of elements in the mesh.size (
Union[Expression,int,float]) – The size of the mesh, i.e. the length of the line.minimum (
Union[Expression,int,float]) – The position of the left boundary, i.e. the line ranges fromminimumtominimum + size.name (
Union[str,Callable[[float],str]]) – The name of the domain or a function that returns the name based on the center of each element. This allows to create multiple domains in the same mesh, where the interfaces in between are automatically created and named based on the domain names separated with an underscore.left_name (
str) – The name of the left boundary.right_name (
str) – The name of the right boundary.nodal_dimension (
Optional[int]) – The nodal dimension of the mesh, can be used to curve the mesh later on.periodic (
bool) – Whether the mesh is periodic.
- class pyoomph.meshes.simplemeshes.PointMesh(domain_name='domain', nodal_dimension=0)[source]
Bases:
MeshTemplateA mesh consisting of a single point (without any spatial coordinates). This is useful to use the normal mode expansion to a 1d problem
- class pyoomph.meshes.simplemeshes.RectangularQuadMesh(*, name='domain', size=1.0, N=10, lower_left=[0, 0], periodic=False, split_in_tris=False, split_scott_vogelius=False, boundary_names={}, nodal_dimension=None)[source]
Bases:
MeshTemplateA class representing a rectangular mesh consisting of quadrilateral elements by default.
- Parameters:
name (
Union[str,Callable[[float,float],str]]) – The name of the domain or a function that returns the name based on the center coordinates of each element. The interfaces in between are automatically generated and named based on the domain names separated with an underscore.size (
Union[Expression,int,float,List[Union[Expression,int,float]]]) – The size of the mesh, either by a single value (for both directions) or by two values (for x and y directions).N (
Union[int,List[int]]) – The number of elements in each dimension.. Can be a single value or a list of two values for x and y dimensions respectively.lower_left (
Union[Expression,int,float,List[Union[Expression,int,float]]]) – The coordinates of the lower-left corner of the mesh, i.e. the mesh ranges fromlower_left[0]tolower_left[0] + size[0]in x-direction andlower_left[1]tolower_left[1] + size[1]]in y-direction.periodic (
Union[bool,List[bool]]) – Whether the mesh is periodic, either in both directions or in x and y directions separately.split_in_tris (
Literal[False,'alternate_left','alternate_right','left','right','crossed']) – Split the quadrilateral elements into triangles.split_scott_vogelius (
bool) – Whether to use splitting into Scott-Vogelius elements.boundary_names (
Dict[str,Union[str,Callable[[float],str]]]) – A dictionary mapping boundary names"left","right","top","bottom"to their corresponding names. Alternatively a function, which also takes the center coordinates of each element as input, can be used to define the boundary names.nodal_dimension (
Optional[int]) – The nodal dimension of the mesh, can be used to curve the mesh later on.
- class pyoomph.meshes.simplemeshes.SphericalOctantMesh(radius=1, inner_factor=0.4, domain_name='domain', interface_names={'plane_x0': 'plane_x0', 'plane_y0': 'plane_y0', 'shell': 'shell'})[source]
Bases:
MeshTemplateCreates a coarse spherical octant.
- Parameters:
radius (
Union[Expression,int,float]) – The radius of the sphere.inner_factor (
float) – The factor by which the inner radius of the quadratic elements is smaller than the sphere radius.domain_name (
str) – The name of the domain.interface_names (
Dict[str,str]) – A dictionary mapping the interface names to their corresponding names.