sfepy.fem.domain module¶
Computational domain, consisting of the mesh and regions.
-
class
sfepy.fem.domain.Domain(name, mesh, verbose=False)[source]¶ Domain is divided into groups, whose purpose is to have homogeneous data shapes.
-
create_region(name, select, flags=None, check_parents=True, functions=None, add_to_regions=True)[source]¶ Region factory constructor. Append the new region to self.regions list.
-
create_surface_group(region)[source]¶ Create a new surface group corresponding to region if it does not exist yet.
Notes
Surface groups define surface facet connectivity that is needed for
sfepy.fem.mappings.SurfaceMapping.
-
fix_element_orientation()[source]¶ Ensure element nodes ordering giving positive element volume.
The groups with elements of lower dimension than the space dimension are skipped.
-
get_diameter()[source]¶ Return the diameter of the domain.
Notes
The diameter corresponds to the Friedrichs constant.
-
get_mesh_bounding_box()[source]¶ Return the bounding box of the underlying mesh.
Returns: bbox : ndarray (2, dim)
The bounding box with min. values in the first row and max. values in the second row.
-
refine()[source]¶ Uniformly refine the domain mesh.
Returns: domain : Domain instance
The new domain with the refined mesh.
Notes
Works only for meshes with single element type! Does not preserve node groups!
-
save_regions(filename, region_names=None)[source]¶ Save regions as individual meshes.
Parameters: filename : str
The output filename.
region_names : list, optional
If given, only the listed regions are saved.
-
save_regions_as_groups(filename, region_names=None)[source]¶ Save regions in a single mesh but mark them by using different element/node group numbers.
If regions overlap, the result is undetermined, with exception of the whole domain region, which is marked by group id 0.
Region masks are also saved as scalar point data for output formats that support this.
Parameters: filename : str
The output filename.
region_names : list, optional
If given, only the listed regions are saved.
-

