xc
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members

Finite element mesh. More...

#include <Mesh.h>

Inheritance diagram for XC::Mesh:
XC::MeshComponentContainer XC::MovableObject XC::DistributedBase

Public Member Functions

 Mesh (CommandEntity *owr)
 Constructor.
 
 Mesh (CommandEntity *owr, TaggedObjectStorage &theNodesStorage, TaggedObjectStorage &theElementsStorage)
 Constructor.
 
 Mesh (CommandEntity *owr, TaggedObjectStorage &theStorageType)
 Constructor.
 
virtual ~Mesh (void)
 Destructor.
 
virtual bool addNode (Node *)
 Adds to the domain the node being passed as parameter. More...
 
virtual bool removeNode (int tag)
 Remove from mesh the node identified by the argument. More...
 
virtual bool addElement (Element *)
 Appends to the mesh the element being passed as parameter. More...
 
virtual bool removeElement (int tag)
 Deletes the element identified by the tag being passed as parameter. More...
 
virtual void clearAll (void)
 Deletes from domain all its components (nodes, elements, loads and constraints). More...
 
void setNodeReactionException (const int &)
 Assign the exception for reaction checking (see Mesh::checkNodalReactions).
 
bool checkNodalReactions (const double &)
 Checks that all free nodes have zero reactions.
 
void clearDOF_GroupPtr (void)
 Clears the pointers to node DOF groups.
 
void setGraphBuiltFlags (const bool &f)
 Returns true if the modelo ha cambiado.
 
int initialize (void)
 Inicializa.
 
virtual int setRayleighDampingFactors (const RayleighDampingFactors &rF)
 Set Rayleigh damping factors.
 
const TaggedObjectStorage * nodes (void) const
 
TaggedObjectStorage * nodes (void)
 
const TaggedObjectStorage * elements (void) const
 
TaggedObjectStorage * elements (void)
 
virtual ElementItergetElements ()
 Returns an iterator to the mesh elements.
 
virtual NodeItergetNodes ()
 Returns an iterator a the nodes del domain.
 
const NodeLockersgetNodeLockers (void) const
 
NodeLockersgetNodeLockers (void)
 
bool existElement (int tag)
 Returns true if the mesh has an element with the tag being passed as parameter.
 
virtual ElementgetElement (int tag)
 Returns a pointer to the element identified by the tag being passed as parameter.
 
virtual const ElementgetElement (int tag) const
 Returns a pointer to the element identified by the tag being passed as parameter.
 
ElementgetNearestElement (const Pos3d &p)
 Returns a pointer to the nearest element to the point being passed as parameter.
 
const ElementgetNearestElement (const Pos3d &p) const
 Returns a pointer to the nearest element to the point being passed as parameter.
 
bool existNode (int tag)
 Returns true if the mesh has a node with the tag being passed as parameter.
 
virtual NodegetNode (int tag)
 Returns a pointer to the node which tag being passed as parameter.
 
virtual const NodegetNode (int tag) const
 Returns a pointer to the node which tag being passed as parameter.
 
NodegetNearestNode (const Pos3d &p)
 Returns the node closest to the point being passed as parameter.
 
const NodegetNearestNode (const Pos3d &p) const
 Returns the node closest to the point being passed as parameter.
 
virtual int getNumElements (void) const
 Returns the number of elements.
 
virtual int getNumNodes (void) const
 Returns the number of nodes.
 
size_t getNumDeadElements (void) const
 Returns the number of inactive elements on the mesh.
 
size_t getNumLiveElements (void) const
 Returns the number of active elements on the mesh.
 
size_t getNumDeadNodes (void) const
 Returns the number of inactive nodes on the mesh.
 
size_t getNumLiveNodes (void) const
 Returns the number of active nodes on the mesh.
 
size_t getNumFrozenNodes (void) const
 Returns the number of frozen nodes on the mesh.
 
size_t getNumFreeNodes (void) const
 Returns the number of free nodes on the mesh.
 
virtual const VectorgetPhysicalBounds (void)
 
const std::vector< std::string > & getNombresCoordenadas (void) const
 
std::string getNombreUnidades (void) const
 
virtual int buildEleGraph (Graph &theEleGraph)
 Builds the element's graph. More...
 
virtual int buildNodeGraph (Graph &theNodeGraph)
 Builds the node graph. More...
 
virtual GraphgetElementGraph (void)
 Builds the elements graph of the mesh (if not builded yet) and returns a reference to it. More...
 
virtual GraphgetNodeGraph (void)
 Builds (if needed) the graph of the domain nodes and returns a reference to it. More...
 
virtual int commit (void)
 Commits mesh state.
 
virtual int revertToLastCommit (void)
 Returns the mesh to its last commited state.
 
virtual int revertToStart (void)
 Return the mesh into its initial state.
 
int update (void)
 Update the element's state. More...
 
void freeze_dead_nodes (const std::string &nmbLocker)
 Freezes inactive nodes (prescribes zero displacement for all DOFs on inactive nodes). More...
 
void melt_alive_nodes (const std::string &nmbLocker)
 Clears the constraints over activated nodes previously created by the freeze method. More...
 
const double getEffectiveModalMass (int mode) const
 Return the masa modal efectiva corresponding to the mode i. More...
 
Vector getEffectiveModalMasses (const int &numModes) const
 Returns the masas modales efectivas.
 
void zeroLoads (void)
 Loop over nodes and elements getting them to first zero their loads.
 
virtual void Print (std::ostream &s, int flag=0)
 Imprime el domain.
 
virtual int sendSelf (CommParameters &)
 Sends object through the channel being passed as parameter.
 
virtual int recvSelf (const CommParameters &)
 Receives object through the channel being passed as parameter.
 
virtual double getNodeDisp (int nodeTag, int dof, int &errorFlag)
 Returns the component of the displacement of the node wich the tag is being passed as parameter. More...
 
virtual int setMass (const Matrix &mass, int nodeTag)
 Set the mass matrix for the node identified by the argument.
 
virtual int calculateNodalReactions (bool inclInertia, const double &)
 Calculate nodal reaction forces and moments. More...
 
- Public Member Functions inherited from XC::MeshComponentContainer
 MeshComponentContainer (CommandEntity *owr, int classTag, int dbTag=0)
 Constructor.
 
const DomaingetDomain (void) const
 Returns a pointer to the mesh domain.
 
DomaingetDomain (void)
 Returns a pointer to the mesh domain.
 
- Public Member Functions inherited from XC::MovableObject
 MovableObject (int classTag, int dbTag)
 Constructor. More...
 
 MovableObject (int classTag)
 Constructor. More...
 
 MovableObject (const MovableObject &)
 Copy constructor. Doesn't copy the dbTag.
 
MovableObjectoperator= (const MovableObject &)
 Assignment operator. Doesn't copy the dbTag.
 
int getClassTag (void) const
 Return the class identifier.
 
int getDbTag (void) const
 Return the object identifier in the database.
 
int getDbTag (CommParameters &)
 Return the object identifier in the database.
 
void setDbTag (int dbTag)
 Sets the object identifier in the database.
 
void setDbTag (CommParameters &)
 Sets the object identifier in the database if not already set. More...
 
virtual int setParameter (const std::vector< std::string > &argv, Parameter &param)
 Sets the value param to the parameter argv.
 
virtual int updateParameter (int parameterID, Information &info)
 Updates the parameter identified by parameterID with info.
 
virtual int activateParameter (int parameterID)
 Activates the parameter identified by parameterID.
 
virtual int setVariable (const std::string &variable, Information &)
 Set the value of the variable idenfified by var.
 
virtual int getVariable (const std::string &variable, Information &)
 Return the value of the variable idenfified by var.
 
- Public Member Functions inherited from XC::DistributedBase
 DistributedBase (void)
 Constructor.
 
const int & getDbTagDataPos (const int &i) const
 Returns the data at the i-th position.
 
void setDbTagDataPos (const int &i, const int &v)
 Sets the data at the i-th position.
 
void inicComm (const int &dataSize) const
 Initializes communication.
 

Static Public Member Functions

static void setDeadSRF (const double &)
 Assigns Stress Reduction Factor for element deactivation.
 

Protected Member Functions

void free_mem (void)
 Frees memory occupied by mesh components. More...
 
DbTagDatagetDbTagData (void) const
 Returns a vector to store the dbTags de los miembros of the clase. More...
 
int sendData (CommParameters &)
 Send object members through the channel being passed as parameter.
 
int recvData (const CommParameters &)
 Receives object members through the channel being passed as parameter.
 

Friends

std::ostream & operator<< (std::ostream &, Mesh &)
 

Detailed Description

Finite element mesh.

Member Function Documentation

§ addElement()

bool XC::Mesh::addElement ( Element element)
virtual

Appends to the mesh the element being passed as parameter.

To add the element pointed to by theElementPtr to the domain. In addition the domain always checks to ensure that no other element with the same tag exists in the domain. If the checks are successful, the element is added to the mesh by invoking addComponent(theElePtr) on the container for the elements. The mesh then invokes add_element_to_domain() on the element. The call returns true if the element is added, otherwise an error message is displayed ant false is returned.

§ addNode()

bool XC::Mesh::addNode ( Node node)
virtual

Adds to the domain the node being passed as parameter.

To add the node pointed to by node to the mesh. The domain first checks that no other node with the same tag, has been previously added to the domain. The mesh will then add the node to it's node container object, by invoking addComponent(node). If successful, the mesh invokes add_node_to_domain(node) on the node. The call returns true if the node was added, otherwise an error is printed and false is returned.

§ buildEleGraph()

int XC::Mesh::buildEleGraph ( Graph theEleGraph)
virtual

Builds the element's graph.

A method which will cause the mesh to discard the current element graph and build a new one based on the element connectivity. Returns \(0\) if successful otherwise \(-1\) is returned along with an error message.

§ buildNodeGraph()

int XC::Mesh::buildNodeGraph ( Graph theNodeGraph)
virtual

Builds the node graph.

A method which will cause the mesh to discard the current node graph and build a new one based on the node connectivity. Returns \(0\) if successful otherwise \(-1\) is returned along with an error message.

§ calculateNodalReactions()

int XC::Mesh::calculateNodalReactions ( bool  inclInertia,
const double &  tol 
)
virtual

Calculate nodal reaction forces and moments.

Parameters
inclInertiaif True, the unbalance load vector for each node is calculated including inertial forces.
toltolerance for the checking of reactions.

§ clearAll()

void XC::Mesh::clearAll ( void  )
virtual

Deletes from domain all its components (nodes, elements, loads and constraints).

GENERAL NOTE ON REMOVAL OF COMPONENTS: downward casts (while bad) are o.k. as only the type of components can be added to the storage objects, e.g. only elements can be added to theElements therefore casting a XC::MeshComponent from theElements to an XC::Element is o.k.

§ free_mem()

void XC::Mesh::free_mem ( void  )
protected

Frees memory occupied by mesh components.

this calls delete on all components of the model, i.e. calls delete on all that is added to the model. WARNING: if 3rd constructor, TaggedObjectStorage objects passed must have been created with new_ and nowhere else must the destructor be called.

§ freeze_dead_nodes()

void XC::Mesh::freeze_dead_nodes ( const std::string &  nmbLocker)

Freezes inactive nodes (prescribes zero displacement for all DOFs on inactive nodes).

§ getDbTagData()

XC::DbTagData & XC::Mesh::getDbTagData ( void  ) const
protectedvirtual

Returns a vector to store the dbTags de los miembros of the clase.

Reimplemented from XC::DistributedBase.

§ getEffectiveModalMass()

const double XC::Mesh::getEffectiveModalMass ( int  mode) const

Return the masa modal efectiva corresponding to the mode i.

§ getElementGraph()

XC::Graph & XC::Mesh::getElementGraph ( void  )
virtual

Builds the elements graph of the mesh (if not builded yet) and returns a reference to it.

Returns the current element graph (the connectivity of the elements in the mesh). If the eleChangeFlag has been set to true the method will invoke {buildEleGraph(theEleGraph)} on itself before returning the graph. The vertices in the element graph are to be labeled \(0\) through \(numEle-1\). The vertices references contain the elemental tags.

§ getNodeDisp()

double XC::Mesh::getNodeDisp ( int  nodeTag,
int  dof,
int &  errorFlag 
)
virtual

Returns the component of the displacement of the node wich the tag is being passed as parameter.

Parameters
nodeTagnode identifier.
dofdegree of freedom component.
errorFlagerror indicator.

§ getNodeGraph()

XC::Graph & XC::Mesh::getNodeGraph ( void  )
virtual

Builds (if needed) the graph of the domain nodes and returns a reference to it.

Returns the current node graph (the connectivity of the nodes in the domain). If the nodeChangeFlag has been set to true the will invoke {buildNodeGraph(theNodeGraph)} on itself before returning the graph. The vertices in the node graph are to be labeled \(0\) through \(numNode-1\). The Vertices references contain the nodal tags.

§ getPhysicalBounds()

const XC::Vector & XC::Mesh::getPhysicalBounds ( void  )
virtual

This information is built up as nodes are added to the domain, initially all are set to \(0\) in the constructor.

§ melt_alive_nodes()

void XC::Mesh::melt_alive_nodes ( const std::string &  nmbLocker)

Clears the constraints over activated nodes previously created by the freeze method.

§ removeElement()

bool XC::Mesh::removeElement ( int  tag)
virtual

Deletes the element identified by the tag being passed as parameter.

To remove the element whose tag is given by tag from the mesh. This is achieved by invoking {removeComponent(tag)} on the container for the elements. Returns \(0\) if no such element exists in the domain. Otherwise the domain invokes {setDomain(nullptr)} on the element (using a cast to go from a TaggedObject to an Element, which is safe as only an Element objects are added to this container) and {domainChange()} on itself before a pointer to the element is returned.

§ removeNode()

bool XC::Mesh::removeNode ( int  tag)
virtual

Remove from mesh the node identified by the argument.

To remove the node whose tag is given by tag from the domain. This is achieved ty by invoking {removeComponent(tag)} on the container for the nodes. Returns \(0\) if no such node exists in the domain. If the node is to be removed the domain invokes {setDomain(nullptr)} on the node and {domainChange()} on itself before a pointer to the Node is returned.

§ update()

int XC::Mesh::update ( void  )

Update the element's state.

Called by the domain to update the state of the mesh. Iterates over all the elements and invokes {update()}.


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