Smith  0.1
Smith is an implicit thermal structural mechanics simulation code.
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
smith::Domain Struct Reference

a class for representing a geometric region that can be used for integration More...

#include <domain.hpp>

Public Types

enum  Type { Elements , BoundaryElements , InteriorBoundaryElements }
 enum describing what kind of elements are included in a Domain
 

Public Member Functions

 Domain (const mesh_t &m, int d, Type type)
 empty Domain constructor, with connectivity info to be populated later
 
const std::vector< int > & get (mfem::Geometry::Type geom) const
 get elements by geometry type
 
const std::vector< int > & get_mfem_ids (mfem::Geometry::Type geom) const
 get elements by geometry type
 
int total_elements () const
 returns how many elements of any type belong to this domain
 
mfem::Array< int > bOffsets () const
 returns an array of the prefix sum of element counts belonging to this domain. Primarily intended to be used in mfem::BlockVector::Update(double * data, mfem::Array<int> bOffsets);
 
mfem::Array< int > dof_list (const fes_t *fes) const
 get mfem degree of freedom list for a given FiniteElementSpace
 
void insert_restriction (const fes_t *fes, FunctionSpace space)
 create a restriction operator over this domain, using its FunctionSpace as a key More...
 
const BlockElementRestrictionget_restriction (FunctionSpace space)
 getter for accessing a restriction operator by its function space
 
void addElement (int geom_id, int elem_id, mfem::Geometry::Type element_geometry)
 Add an element to the domain. More...
 
void addElements (const std::vector< int > &geom_id, const std::vector< int > &elem_id, mfem::Geometry::Type element_geometry)
 Add a batch of elements to the domain. More...
 
void insert_shared_interior_face_list ()
 Find the list of interior faces shared by two processors to make sure these faces are only integrated once.
 

Static Public Member Functions

static Domain ofVertices (const mesh_t &mesh, std::function< bool(vec2)> func)
 create a domain from some subset of the vertices in an mfem::Mesh More...
 
static Domain ofVertices (const mesh_t &mesh, std::function< bool(vec3)> func)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
static Domain ofEdges (const mesh_t &mesh, std::function< bool(std::vector< vec2 >, int)> func)
 create a domain from some subset of the edges in an mfem::Mesh More...
 
static Domain ofEdges (const mesh_t &mesh, std::function< bool(std::vector< vec3 >)> func)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
static Domain ofFaces (const mesh_t &mesh, std::function< bool(std::vector< vec2 >, int)> func)
 create a domain from some subset of the faces in an mfem::Mesh More...
 
static Domain ofFaces (const mesh_t &mesh, std::function< bool(std::vector< vec3 >, int)> func)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
static Domain ofElements (const mesh_t &mesh, std::function< bool(std::vector< vec2 >, int)> func)
 create a domain from some subset of the elements (spatial dim == geometry dim) in an mfem::Mesh More...
 
static Domain ofElements (const mesh_t &mesh, std::function< bool(std::vector< vec3 >, int)> func)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
static Domain ofBoundaryElements (const mesh_t &mesh, std::function< bool(std::vector< vec2 >, int)> func)
 create a domain from some subset of the boundary elements (spatial dim == geometry dim + 1) in an mfem::Mesh More...
 
static Domain ofBoundaryElements (const mesh_t &mesh, std::function< bool(std::vector< vec3 >, int)> func)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
static Domain ofInteriorBoundaryElements (const mesh_t &mesh, std::function< bool(std::vector< vec2 >, int)> func)
 create a domain from some subset of the interior boundary elements in an a mesh More...
 
static Domain ofInteriorBoundaryElements (const mesh_t &mesh, std::function< bool(std::vector< vec3 >, int)> func)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Public Attributes

const mesh_t & mesh_
 the underyling mesh for this domain
 
int dim_
 the geometric dimension of the domain
 
Type type_
 whether the elements in this domain are on the boundary or not
 
std::map< FunctionSpace, BlockElementRestrictionrestriction_operators
 a collection of restriction operators for the different test/trial spaces appearing in integrals evaluated over this Domain. These are stored on the Domain itself to avoid duplicating these restriction operators in each Integral over a given Domain.
 
std::vector< int > shared_interior_face_ids_
 Ids of interior faces that lie on the boundary shared by two processors.
 

Static Public Attributes

static constexpr int num_types = 3
 the number of entries in the Type enum
 

Detailed Description

a class for representing a geometric region that can be used for integration

This region can be an entire mesh or some subset of its elements

Definition at line 33 of file domain.hpp.

Member Function Documentation

◆ addElement()

void smith::Domain::addElement ( int  geom_id,
int  elem_id,
mfem::Geometry::Type  element_geometry 
)

Add an element to the domain.

This is meant for internal use on the class. Prefer to use the factory methods (ofElements, ofBoundaryElements, etc) to create domains and thereby populate the element lists.

Definition at line 268 of file domain.cpp.

◆ addElements()

void smith::Domain::addElements ( const std::vector< int > &  geom_id,
const std::vector< int > &  elem_id,
mfem::Geometry::Type  element_geometry 
)

Add a batch of elements to the domain.

This is meant for internal use on the class. Prefer to use the factory methods (ofElements, ofBoundaryElements, etc) to create domains and thereby populate the element lists.

Definition at line 290 of file domain.cpp.

◆ insert_restriction()

void smith::Domain::insert_restriction ( const fes_t *  fes,
FunctionSpace  space 
)

create a restriction operator over this domain, using its FunctionSpace as a key

Note
if a restriction for the given key (i.e. FunctionSpace) already exists, this function does nothing

Definition at line 536 of file domain.cpp.

◆ ofBoundaryElements()

Domain smith::Domain::ofBoundaryElements ( const mesh_t &  mesh,
std::function< bool(std::vector< vec2 >, int)>  func 
)
static

create a domain from some subset of the boundary elements (spatial dim == geometry dim + 1) in an mfem::Mesh

Parameters
meshthe entire mesh
funcpredicate function for determining which boundary elements will be included in this domain

Definition at line 368 of file domain.cpp.

◆ ofEdges()

Domain smith::Domain::ofEdges ( const mesh_t &  mesh,
std::function< bool(std::vector< vec2 >, int)>  func 
)
static

create a domain from some subset of the edges in an mfem::Mesh

Parameters
meshthe entire mesh
funcpredicate function for determining which edges will be included in this domain. The function's arguments are the list of vertex coordinates and an attribute index (if appropriate).

Definition at line 102 of file domain.cpp.

◆ ofElements()

Domain smith::Domain::ofElements ( const mesh_t &  mesh,
std::function< bool(std::vector< vec2 >, int)>  func 
)
static

create a domain from some subset of the elements (spatial dim == geometry dim) in an mfem::Mesh

Parameters
meshthe entire mesh
funcpredicate function for determining which elements will be included in this domain. The function's arguments are the list of vertex coordinates and an attribute index (if appropriate).

Definition at line 258 of file domain.cpp.

◆ ofFaces()

Domain smith::Domain::ofFaces ( const mesh_t &  mesh,
std::function< bool(std::vector< vec2 >, int)>  func 
)
static

create a domain from some subset of the faces in an mfem::Mesh

Parameters
meshthe entire mesh
funcpredicate function for determining which faces will be included in this domain. The function's arguments are the list of vertex coordinates and an attribute index (if appropriate).

Definition at line 182 of file domain.cpp.

◆ ofInteriorBoundaryElements()

Domain smith::Domain::ofInteriorBoundaryElements ( const mesh_t &  mesh,
std::function< bool(std::vector< vec2 >, int)>  func 
)
static

create a domain from some subset of the interior boundary elements in an a mesh

Parameters
meshthe entire mesh
funcpredicate function for determining which interior boundary elements will be included in this domain. The function's arguments are the list of vertex coordinates and an attribute index (if appropriate).

Definition at line 729 of file domain.cpp.

◆ ofVertices()

static Domain smith::Domain::ofVertices ( const mesh_t &  mesh,
std::function< bool(vec2)>  func 
)
static

create a domain from some subset of the vertices in an mfem::Mesh

Parameters
meshthe entire mesh
funcpredicate function for determining which vertices will be included in this domain. The function's argument is the spatial position of the vertex.

The documentation for this struct was generated from the following files: