Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations
Mesh Class Reference

Class for defining a mesh that stores the nodes, materials, elements, and loads. More...

#include <Mesh.hpp>

Collaboration diagram for Mesh:

Public Member Functions

 Mesh ()
 Creates a Mesh object (container) to store Node, Material, Element, Load. More...
 
 ~Mesh ()
 Destroys this Mesh object. More...
 
void Initialize ()
 Initialize the Mesh and compute memory storage. More...
 
void AddNode (unsigned int tag, std::shared_ptr< Node > &node)
 Add a Node object to the Mesh. More...
 
void AddConstraint (unsigned int tag, std::shared_ptr< Constraint > &constraint)
 Add a Constraint to the Mesh. More...
 
void AddFiber (unsigned int tag, std::unique_ptr< Material > &fiber)
 Add a Material to the Mesh. More...
 
void AddMaterial (unsigned int tag, std::unique_ptr< Material > &material)
 Add a Material to the Mesh. More...
 
void AddSection (unsigned int tag, std::unique_ptr< Section > &section)
 Add a Section to the Mesh. More...
 
void AddDamping (unsigned int tag, std::shared_ptr< Damping > &damping)
 Add a Damping model to the Mesh. More...
 
void AddElement (unsigned int tag, std::shared_ptr< Element > &element)
 Add a Element to the Mesh. More...
 
void AddLoad (unsigned int tag, std::shared_ptr< Load > &load)
 Add a Load to the Mesh. More...
 
void AddMass (unsigned int tag, Eigen::VectorXd &mass)
 Add a point mass to a Node. More...
 
void DelNode (unsigned int tag)
 Remove a Node from Mesh. More...
 
void DelMass (unsigned int tag)
 Remove a Point Mass from Mesh. More...
 
void DelSupportMotion (unsigned int tag)
 Remove the support motions associated to Node in from Mesh. More...
 
void DelConstraint (int tag)
 Remove a Constraint from Mesh. More...
 
void DelMaterial (unsigned int tag)
 Remove a Material from Mesh. More...
 
void DelSection (unsigned int tag)
 Remove a Section from Mesh. More...
 
void DelElement (unsigned int tag)
 Remove an Element from Mesh. More...
 
void DelDamping (unsigned int tag)
 
void DelLoad (unsigned int tag)
 Remove a Load from Mesh. More...
 
void SetDamping (unsigned int tag, std::vector< unsigned int > &group)
 Add a Damping model to the Mesh. More...
 
void SetInitialCondition (unsigned int tag, int cond, Eigen::VectorXd &Xo)
 Specifies the Node initial condition. More...
 
void SetSupportMotion (unsigned int tag, unsigned int dof, std::vector< double > &Xo)
 Specifies the support motion for a certain Node object. More...
 
std::unique_ptr< Material > & GetMaterial (unsigned int tag)
 Gets a material from the mesh. More...
 
std::unique_ptr< Section > & GetSection (unsigned int tag)
 Gets a section from the mesh. More...
 
std::shared_ptr< Damping > & GetDamping (unsigned int tag)
 Gets damping from the mesh. More...
 
std::map< unsigned int, std::shared_ptr< Node > > & GetNodes ()
 Gets nodes from the mesh. More...
 
std::map< int, std::shared_ptr< Constraint > > & GetConstraints ()
 Gets constraint from the mesh. More...
 
std::map< unsigned int, std::shared_ptr< Element > > & GetElements ()
 Gets elements from the mesh. More...
 
std::map< unsigned int, std::shared_ptr< Damping > > & GetDampings ()
 Gets all damping from the mesh. More...
 
std::map< unsigned int, std::shared_ptr< Load > > & GetLoads ()
 Gets loads from the mesh. More...
 
template<typename T >
std::vector< T > GetVectorIDs (std::string Name)
 Returns a vector with identifier of the property requested. More...
 
Eigen::SparseMatrix< double > GetTotalToFreeMatrix ()
 Gets operator that impose restrains/constraints on the model. More...
 

Protected Attributes

std::map< unsigned int, std::shared_ptr< Node > > Nodes
 Container/map of nodes for this partition. More...
 
std::map< int, std::shared_ptr< Constraint > > Constraints
 Container/map of constraints for this partition. More...
 
std::map< unsigned int, std::unique_ptr< Material > > Materials
 Container/map of materials for this partition. More...
 
std::map< unsigned int, std::unique_ptr< Section > > Sections
 Container/map of materials for this partition. More...
 
std::map< unsigned int, std::shared_ptr< Damping > > Dampings
 Container/map of damping for this partition. More...
 
std::map< unsigned int, std::shared_ptr< Element > > Elements
 Container/map of elements for this partition. More...
 
std::map< unsigned int, std::shared_ptr< Load > > Loads
 Container/map of loads for this partition. More...
 

Detailed Description

Class for defining a mesh that stores the nodes, materials, elements, and loads.

See also
Node.hpp Element.hpp Material.hpp Section.hpp Load.hpp

Constructor & Destructor Documentation

◆ Mesh()

Mesh::Mesh ( )

Creates a Mesh object (container) to store Node, Material, Element, Load.

Note
More details can be found at Mesh.

◆ ~Mesh()

Mesh::~Mesh ( )

Destroys this Mesh object.

Member Function Documentation

◆ AddConstraint()

void Mesh::AddConstraint ( unsigned int  tag,
std::shared_ptr< Constraint > &  constraint 
)

Add a Constraint to the Mesh.

Parameters
tagthe Constraint identifier.
constraintthe Constraint object to be added.
See also
Constraint.

◆ AddDamping()

void Mesh::AddDamping ( unsigned int  tag,
std::shared_ptr< Damping > &  damping 
)

Add a Damping model to the Mesh.

Parameters
tagthe Damping identifier.
dampingthe Damping object to be added.
See also
Damping.

◆ AddElement()

void Mesh::AddElement ( unsigned int  tag,
std::shared_ptr< Element > &  element 
)

Add a Element to the Mesh.

Parameters
tagthe Element identifier.
elementthe Element object to be added.
See also
Element.

◆ AddFiber()

void Mesh::AddFiber ( unsigned int  tag,
std::unique_ptr< Material > &  fiber 
)

Add a Material to the Mesh.

Parameters
tagthe Material identifier.
fiberthe Material object to be added in fiber.
See also
Material.

◆ AddLoad()

void Mesh::AddLoad ( unsigned int  tag,
std::shared_ptr< Load > &  load 
)

Add a Load to the Mesh.

Parameters
tagthe Load identifier.
loadthe Load object to be added.
See also
Load.

◆ AddMass()

void Mesh::AddMass ( unsigned int  tag,
Eigen::VectorXd &  mass 
)

Add a point mass to a Node.

Parameters
tagthe Node identifier.
massthe vector with masses at each degree-of-freedom.
See also
Node::SetMass(), Node::GetMass(), Node::Mass.

◆ AddMaterial()

void Mesh::AddMaterial ( unsigned int  tag,
std::unique_ptr< Material > &  material 
)

Add a Material to the Mesh.

Parameters
tagthe Material identifier.
materialthe Material object to be added.
See also
Material.

◆ AddNode()

void Mesh::AddNode ( unsigned int  tag,
std::shared_ptr< Node > &  node 
)

Add a Node object to the Mesh.

Parameters
tagthe Node identifier.
nodethe Node object to be added.
See also
Node.

◆ AddSection()

void Mesh::AddSection ( unsigned int  tag,
std::unique_ptr< Section > &  section 
)

Add a Section to the Mesh.

Parameters
tagthe Section identifier.
sectionthe Section object to be added.
See also
Section.

◆ DelConstraint()

void Mesh::DelConstraint ( int  tag)

Remove a Constraint from Mesh.

Parameters
tagthe Constraint identifier to be removed.
See also
Constraint.

◆ DelDamping()

void Mesh::DelDamping ( unsigned int  tag)
Parameters
tagthe Damping identifier to be removed.
See also
Damping.

◆ DelElement()

void Mesh::DelElement ( unsigned int  tag)

Remove an Element from Mesh.

Parameters
tagthe Element identifier to be removed.
See also
Element.

◆ DelLoad()

void Mesh::DelLoad ( unsigned int  tag)

Remove a Load from Mesh.

Parameters
tagthe Load identifier to be removed.
See also
Load.

◆ DelMass()

void Mesh::DelMass ( unsigned int  tag)

Remove a Point Mass from Mesh.

Parameters
tagthe Node identifier where the mass is removed.
See also
Node.

◆ DelMaterial()

void Mesh::DelMaterial ( unsigned int  tag)

Remove a Material from Mesh.

Parameters
tagthe Material identifier to be removed.
See also
Material.

◆ DelNode()

void Mesh::DelNode ( unsigned int  tag)

Remove a Node from Mesh.

Parameters
tagthe Node identifier to be removed.
See also
Node.

◆ DelSection()

void Mesh::DelSection ( unsigned int  tag)

Remove a Section from Mesh.

Parameters
tagthe Section identifier to be removed.
See also
Section.

◆ DelSupportMotion()

void Mesh::DelSupportMotion ( unsigned int  tag)

Remove the support motions associated to Node in from Mesh.

Parameters
tagthe Node identifier where the mass is removed.
See also
Node.

◆ GetConstraints()

std::map<int, std::shared_ptr<Constraint> >& Mesh::GetConstraints ( )

Gets constraint from the mesh.

Returns
A map with all Constraint in the Mesh object.
Note
More details can be found at Mesh.
See also
Constraint.

◆ GetDamping()

std::shared_ptr<Damping>& Mesh::GetDamping ( unsigned int  tag)

Gets damping from the mesh.

Parameters
tagThe damping tag to be obtained.
Returns
A Damping pointer.
Note
More details can be found at Mesh.
See also
Damping.

◆ GetDampings()

std::map<unsigned int, std::shared_ptr<Damping> >& Mesh::GetDampings ( )

Gets all damping from the mesh.

Returns
A map with all Damping in the Mesh object.
Note
More details can be found at Mesh.
See also
Damping.

◆ GetElements()

std::map<unsigned int, std::shared_ptr<Element> >& Mesh::GetElements ( )

Gets elements from the mesh.

Returns
A map with all Element in the Mesh object.
Note
More details can be found at Mesh.
See also
Element.

◆ GetLoads()

std::map<unsigned int, std::shared_ptr<Load> >& Mesh::GetLoads ( )

Gets loads from the mesh.

Returns
A map with all Load in the Mesh object.
Note
More details can be found at Mesh.
See also
Load.

◆ GetMaterial()

std::unique_ptr<Material>& Mesh::GetMaterial ( unsigned int  tag)

Gets a material from the mesh.

Parameters
tagThe material tag to be obtained.
Returns
A Material pointer.
Note
More details can be found at Mesh.
See also
Meterial.

◆ GetNodes()

std::map<unsigned int, std::shared_ptr<Node> >& Mesh::GetNodes ( )

Gets nodes from the mesh.

Returns
A map with all Node in the Mesh object.
Note
More details can be found at Mesh.
See also
Node.

◆ GetSection()

std::unique_ptr<Section>& Mesh::GetSection ( unsigned int  tag)

Gets a section from the mesh.

Parameters
tagThe section tag to be obtained.
Returns
A Section pointer.
Note
More details can be found at Mesh.
See also
Section.

◆ GetTotalToFreeMatrix()

Eigen::SparseMatrix<double> Mesh::GetTotalToFreeMatrix ( )

Gets operator that impose restrains/constraints on the model.

Returns
A matrix that enforce the linear kinematic constraints.
Note
More details can be found at Mesh, and Assembler.
See also
Constraint, Integrator::ComputeEffectiveForce, Integrator::ComputeEffectiveStiffness.

◆ GetVectorIDs()

template<typename T >
std::vector<T> Mesh::GetVectorIDs ( std::string  Name)

Returns a vector with identifier of the property requested.

Parameters
NameThe entity to get the identifiers or tags.
Returns
A vector with the identifiers

◆ Initialize()

void Mesh::Initialize ( )

Initialize the Mesh and compute memory storage.

◆ SetDamping()

void Mesh::SetDamping ( unsigned int  tag,
std::vector< unsigned int > &  group 
)

Add a Damping model to the Mesh.

Parameters
tagthe Damping identifier.
groupthe Element object that shares this damping model.
See also
Damping.

◆ SetInitialCondition()

void Mesh::SetInitialCondition ( unsigned int  tag,
int  cond,
Eigen::VectorXd &  Xo 
)

Specifies the Node initial condition.

Parameters
tagThe Node identifier.
condOption to identify displacement, velocity or acceleration.
XoThe vector of initial conditions.
See also
Node::SetDisplacements, Node::SetVelocities, Node::SetAccelerations.

◆ SetSupportMotion()

void Mesh::SetSupportMotion ( unsigned int  tag,
unsigned int  dof,
std::vector< double > &  Xo 
)

Specifies the support motion for a certain Node object.

Parameters
tagThe Node identifier.
dofThe degree-of-freedom where the support motion is imposed.
XoThe vector of support motion displacement.
See also
Node::SetSupportMotion, Node::GetSupportMotion, Node::SupportMotion.

Member Data Documentation

◆ Constraints

std::map<int, std::shared_ptr<Constraint> > Mesh::Constraints
protected

Container/map of constraints for this partition.

◆ Dampings

std::map<unsigned int, std::shared_ptr<Damping> > Mesh::Dampings
protected

Container/map of damping for this partition.

◆ Elements

std::map<unsigned int, std::shared_ptr<Element> > Mesh::Elements
protected

Container/map of elements for this partition.

◆ Loads

std::map<unsigned int, std::shared_ptr<Load> > Mesh::Loads
protected

Container/map of loads for this partition.

◆ Materials

std::map<unsigned int, std::unique_ptr<Material> > Mesh::Materials
protected

Container/map of materials for this partition.

◆ Nodes

std::map<unsigned int, std::shared_ptr<Node> > Mesh::Nodes
protected

Container/map of nodes for this partition.

◆ Sections

std::map<unsigned int, std::unique_ptr<Section> > Mesh::Sections
protected

Container/map of materials for this partition.