61 explicit Mesh(
size_t dim = 0);
191 bool isNodeFree(
const size_t &i,
const unsigned int &dof)
const {
196 return !(
d_fix[i] >> dof & 1UL);
226 std::vector<util::Point> nds;
285 void setFixity(
const size_t &i,
const unsigned int &dof,
const bool &flag);
301 std::string
printStr(
int nt = 0,
int lvl = 0)
const;
309 void print(
int nt = 0,
int lvl = 0)
const { std::cout <<
printStr(nt, lvl); };
332 void createData(
const std::string &filename,
bool ref_config =
false);
341 std::vector<size_t> enc,
349 std::vector<size_t> enc,
449 std::vector<std::vector<size_t>>
d_nec;
541 std::pair<std::vector<double>, std::vector<double>>
d_bbox;
553 const std::string &volume_error_note);
std::vector< size_t > getElementConnectivity(const size_t &i) const
Get the connectivity of element.
bool d_needEncData
Flag that indicates whether we need enc data (set by input mesh deck in constructor)
void clearElementData()
Clear element-node connectivity data.
bool isNodeFree(const size_t &i, const unsigned int &dof) const
Return true if node is free.
size_t getNumDofs() const
Get the number of dofs.
const std::vector< uint8_t > * getFixityP() const
Get the pointer to fixity data.
const std::vector< size_t > * getElementConnectivitiesP() const
Get the pointer to element-node connectivity data.
std::string d_filename
Filename to read mesh data.
size_t getNumNodes() const
Get the number of nodes.
const std::vector< double > * getNodalVolumesP() const
Get the pointer to nodal volume data.
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.
std::pair< std::vector< double >, std::vector< double > > & getBoundingBox()
Get the bounding box of the mesh.
std::vector< util::Point > getElementConnectivityNodes(const size_t &i) const
Get the vertices of element.
const std::vector< size_t > & getElementConnectivities() const
Get the reference to element-node connectivity data.
std::vector< size_t > d_enc
Element-node connectivity data.
std::vector< size_t > d_nodePartition
Node partition information. For each node i, d_nodePartition[i] specifies the partition number,...
const std::vector< double > & getNodalVolumes() const
Get the nodal volume data.
std::pair< std::vector< double >, std::vector< double > > d_bbox
Bounding box.
std::vector< util::Point > d_nodes
Vector of initial (reference) coordinates of nodes.
util::Point getNode(const size_t &i) const
Get coordinates of node i.
const std::vector< uint8_t > & getFixity() const
Get the reference to fixity data.
bool d_encDataPopulated
Flag that indicates whether element-node connectivity data is read from file.
size_t d_numElems
Number of elements.
bool readElementData(const std::string &filename)
Reads element-node connectivity data from file. This function is meant for cases when mesh was create...
void computeMeshSize()
Compute the mesh size.
std::vector< util::Point > & getNodes()
Get the nodes data.
size_t d_eType
Element type.
size_t d_numNodes
Number of nodes.
size_t d_dim
Dimension of the mesh.
std::vector< double > * getNodalVolumesP()
Get the pointer to nodal volume data.
std::string d_spatialDiscretization
Tag for spatial discretization type.
const std::vector< util::Point > & getNodes() const
Get the nodes data.
const std::pair< std::vector< double >, std::vector< double > > & getBoundingBox() const
Get the bounding box of the mesh.
double getMeshSize() const
Get the mesh size.
size_t d_nPart
Number of partitions.
std::vector< int > d_gInvMap
Map from global id to reduced global id.
void finalizeMeshDerivedFieldsFromCurrentNodes(bool compute_vol_from_elements, const std::string &volume_error_note)
After nodes, enc, nec, and dof-related fields are set: 2D z clear, bbox, optional nodal volume,...
std::vector< size_t > * getElementConnectivitiesP()
Get the pointer to element-node connectivity data.
std::vector< double > & getNodalVolumes()
Get the nodal volume data.
size_t getDimension() const
Get the dimension of the domain.
void setZCoordinateZero()
For , set on all reference nodes (x–y plane). Call before computeBBox() when nodes may carry numeric...
std::vector< uint8_t > d_fix
Vector of fixity mask of each node.
size_t d_numDofs
Number of dofs = (dimension) times (number of nodes)
void setFixity(const size_t &i, const unsigned int &dof, const bool &flag)
Set the fixity to free (0) or fixed (1)
void computeVol()
Compute the nodal volume.
size_t getElementType() const
Get the type of element in mesh.
const std::vector< util::Point > * getNodesP() const
Get the pointer to nodes data.
std::vector< double > d_vol
Vector of volume of each node.
std::vector< uint8_t > * getFixityP()
Get the pointer to fixity data.
void loadFromTetraElements3D(std::vector< util::Point > nodes, std::vector< size_t > enc, const inp::MeshDeck *meshDeck, const inp::ModelDeck *modelDeck)
Populate mesh from 3D tetrahedron data (0-based node indices in enc) without reading a file.
void loadFromTriangleElements2D(std::vector< util::Point > nodes, std::vector< size_t > enc, const inp::MeshDeck *meshDeck, const inp::ModelDeck *modelDeck)
Populate mesh from 2D triangle data (0-based node indices in enc) without reading a file.
void computeBBox()
Compute the bounding box from d_nodes (after setZCoordinateZero() for 2D if applicable).
double getNodalVolume(const size_t &i) const
Get nodal volume of node i.
std::string d_partitionMethod
Partitioning method. It could be either empty string or "metis_recursive" or "metis_kway".
size_t d_eNumVertex
Number of vertex per element.
size_t getNumElements() const
Get the number of elements.
void print(int nt=0, int lvl=0) const
Prints the information about the object.
std::vector< util::Point > * getNodesP()
Get the pointer to nodes data.
void createData(const std::string &filename, bool ref_config=false)
Reads mesh data from the file and populates other data.
std::vector< size_t > & getElementConnectivities()
Get the reference to element-node connectivity data.
std::vector< std::vector< size_t > > d_nec
Node-element connectivity data.
std::vector< size_t > d_gMap
Map from global reduced id to default global id.
double d_h
Characteristic mesh spacing (minimum nodal distance); always from computeMeshSize() after nodes exist...
std::vector< uint8_t > & getFixity()
Get the reference to fixity data.
Collection of methods and database related to input.
Collection of methods and data related to finite element and mesh.
Structure to read and store mesh related input data.
Structure to read and store model related input data.
A structure to represent 3d vectors.