12 #include "util/point.h"
13 #include <hpx/config.hpp>
63 explicit Mesh(
size_t dim = 0);
194 bool isNodeFree(
const size_t &i,
const unsigned int &dof)
const {
199 return !(
d_fix[i] >> dof & 1UL);
229 std::vector<util::Point3> nds;
281 void setMeshData(
const size_t &dim, std::vector<util::Point3> &nodes,
282 std::vector<double> &volumes);
288 void setNodes(std::vector<util::Point3> &nodes);
300 void setFixity(std::vector<uint8_t> &fixity);
308 void setFixity(
const size_t &i,
const unsigned int &dof,
const bool &flag);
340 std::string
printStr(
int nt = 0,
int lvl = 0)
const;
349 void print(
int nt = 0,
int lvl = 0)
const { std::cout <<
printStr(nt, lvl); };
373 void createData(
const std::string &filename,
bool ref_config,
bool is_centroid_based,
bool has_coupling_data);
458 std::vector<std::vector<size_t>>
d_nec;
538 std::pair<std::vector<double>, std::vector<double>>
d_bbox;
A class for mesh data.
Definition: mesh.h:49
void setMeshSize(const double &h)
Set the mesh size.
Definition: mesh.cpp:406
const std::vector< size_t > getPrescribedNodes() const
Get the vector of indicies with prescribed values from the couplign method.
Definition: mesh.h:178
double getMeshSize() const
Get the mesh size.
Definition: mesh.h:116
std::vector< double > d_vol
Vector of volume of each node.
Definition: mesh.h:476
std::string d_spatialDiscretization
Tag for spatial discretization type.
Definition: mesh.h:506
const std::vector< uint8_t > & getFixity() const
Get the reference to fixity data.
Definition: mesh.h:157
const std::pair< std::vector< double >, std::vector< double > > & getBoundingBox() const
Get the bounding box of the mesh.
Definition: mesh.h:261
const std::vector< size_t > & getElementConnectivities() const
Get the reference to element-node connectivity data.
Definition: mesh.h:239
const std::vector< util::Point3 > * getNodesP() const
Get the pointer to nodes data.
Definition: mesh.h:143
double d_h
Mesh size.
Definition: mesh.h:541
std::vector< size_t > getElementConnectivity(const size_t &i) const
Get the connectivity of element.
Definition: mesh.h:216
bool d_keepElementConn
Specify if we keep the element connectivity data.
Definition: mesh.h:544
void setNodalVolumes(std::vector< double > &volumes)
Set the nodal volume data of the mesh.
Definition: mesh.cpp:385
const std::vector< double > & getNodalVolumes() const
Get the nodal volume data.
Definition: mesh.h:164
bool isNodeFree(const size_t &i, const unsigned int &dof) const
Return true if node is free.
Definition: mesh.h:194
size_t d_dim
Dimension of the mesh.
Definition: mesh.h:496
void setMeshData(const size_t &dim, std::vector< util::Point3 > &nodes, std::vector< double > &volumes)
Set the mesh data for finite difference simulations.
Definition: mesh.cpp:356
const std::vector< uint8_t > * getFixityP() const
Get the pointer to fixity data.
Definition: mesh.h:150
std::vector< uint8_t > d_fix
Vector of fixity mask of each node.
Definition: mesh.h:468
void computeBBox()
Compute the bounding box
Definition: mesh.cpp:311
double getNodalVolume(const size_t &i) const
Get nodal volume of node i.
Definition: mesh.h:130
void nodesAtCentroid()
Converts standard fem mesh to particle mesh with nodes at the center of element.
Definition: mesh.cpp:448
void readFromFile(inp::MeshDeck *deck, const std::string &filename)
Reads mesh data from the file and populates other data.
Definition: mesh.cpp:414
size_t d_numElems
Number of elements.
Definition: mesh.h:415
void clearElementData()
Clear element-node connectivity data.
Definition: mesh.cpp:408
size_t getElementType() const
Get the type of element in mesh.
Definition: mesh.h:110
const std::vector< util::Point3 > & getNodes() const
Get the nodes data.
Definition: mesh.h:136
const std::vector< double > * getNodalVolumesP() const
Get the pointer to nodal volume data.
Definition: mesh.h:171
std::pair< std::vector< double >, std::vector< double > > d_bbox
Bounding box.
Definition: mesh.h:538
void computeMeshSize()
Compute the mesh size.
Definition: mesh.cpp:326
size_t d_eType
Element type.
Definition: mesh.h:426
const std::vector< size_t > * getElementConnectivitiesP() const
Get the pointer to element-node connectivity data.
Definition: mesh.h:250
std::string d_filename
Filename to read mesh data.
Definition: mesh.h:509
std::vector< util::Point3 > d_prescribed_values
Vector with the values of all nodes with prescribed boundary data.
Definition: mesh.h:491
std::vector< std::vector< size_t > > d_nec
Node-element connectivity data.
Definition: mesh.h:458
std::vector< size_t > d_enc
Element-node connectivity data.
Definition: mesh.h:452
std::vector< util::Point3 > getElementConnectivityNodes(const size_t &i) const
Get the vertices of element.
Definition: mesh.h:227
void createData(const std::string &filename, bool ref_config, bool is_centroid_based, bool has_coupling_data)
Reads mesh data from the file and populates other data.
Definition: mesh.cpp:102
size_t d_numNodes
Number of nodes.
Definition: mesh.h:412
std::vector< util::Point3 > d_nodes
Vector of initial (reference) coordinates of nodes.
Definition: mesh.h:444
size_t d_eNumVertex
Number of vertex per element.
Definition: mesh.h:441
size_t getNumNodes() const
Get the number of nodes.
Definition: mesh.h:92
void print(int nt=0, int lvl=0) const
Prints the information about the instance of the object.
Definition: mesh.h:349
size_t getNumElements() const
Get the number of elements.
Definition: mesh.h:98
std::vector< size_t > d_gMap
Map from global reduced id to default global id.
Definition: mesh.h:526
std::vector< size_t > d_prescribed_nodes
Vector with the indicies of all nodes with prescribed boundary data.
Definition: mesh.h:483
size_t getDimension() const
Get the dimension of the domain.
Definition: mesh.h:86
void setFixity(std::vector< uint8_t > &fixity)
Set nodal fixity masks.
Definition: mesh.cpp:390
const std::vector< util::Point3 > getPrescribedValues() const
Get the vector of values of the prescribed nodes from the couplign method.
Definition: mesh.h:185
void computeVol()
Compute the nodal volume.
Definition: mesh.cpp:231
util::Point3 getNode(const size_t &i) const
Get coordinates of node i.
Definition: mesh.h:123
void setNodes(std::vector< util::Point3 > &nodes)
Set the nodal data of the mesh.
Definition: mesh.cpp:379
std::vector< int > d_gInvMap
Map from global id to reduced global id.
Definition: mesh.h:532
size_t getNumDofs() const
Get the number of dofs.
Definition: mesh.h:104
size_t d_numDofs
Number of dofs = (dimension) times (number of nodes)
Definition: mesh.h:512
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing information about the instance of the object.
Definition: mesh.cpp:428
Collection of methods and data related to finite element and mesh.
Definition: baseElem.h:15
Collection of methods and database related to input.
Definition: main.cpp:21
Structure to read and store mesh related input data.
Definition: meshDeck.h:23
A structure to represent 3d vectors.
Definition: point.h:29