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:
Inheritance graph
[legend]
Collaboration diagram for XC::Mesh:
Collaboration graph
[legend]

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...
 
bool remove (Node *)
 Removes the the given node. More...
 
virtual bool addElement (Element *)
 Appends to the mesh the element being passed as parameter. More...
 
virtual bool removeElement (int tag)
 Removes from the domain the element identified by the tag being passed as parameter. More...
 
bool remove (Element *)
 Removes the given alement from the mesh. 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. More...
 
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)
 Compute elements initial stiff.
 
virtual int setRayleighDampingFactors (const RayleighDampingFactors &rF)
 Set Rayleigh damping factors.
 
const TaggedObjectStorage * nodes (void) const
 
TaggedObjectStorage * nodes (void)
 
virtual NodeItergetNodes (void)
 Returns an iterator a the nodes del domain.
 
virtual const NodeItergetNodes (void) const
 Returns an iterator a the nodes del domain.
 
int getDefaultNodeTag (void) const
 Get the default tag for the next node.
 
const TaggedObjectStorage * elements (void) const
 
TaggedObjectStorage * elements (void)
 
virtual ElementItergetElements (void)
 Returns an iterator to the mesh elements.
 
virtual const ElementItergetElements (void) const
 Returns an iterator to the mesh elements.
 
int getDefaultElementTag (void) const
 Get the default tag for the next element.
 
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 > & getCoordinateNames (void) const
 
std::string getUnitsNames (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 built 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 committed 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.
 
Matrix getTotalMass (void) const
 Return the total mass matrix.
 
double getTotalMassComponent (const int &) const
 Return the total mass matrix component for the DOF argument.
 
void zeroLoads (void)
 Loop over nodes and elements getting them to first zero their loads.
 
virtual void Print (std::ostream &s, int flag=0) const
 Imprime el domain.
 
virtual int sendSelf (Communicator &)
 Sends object through the communicator argument.
 
virtual int recvSelf (const Communicator &)
 Receives object through the communicator argument.
 
boost::python::dict getPyDict (void) const
 Return a Python dictionary with the object members values.
 
void setPyDict (const boost::python::dict &)
 Set the values of the object members from a Python dictionary.
 
virtual double getNodeDisp (int nodeTag, int dof, int &errorFlag)
 Returns the component of the displacement of the node which 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...
 
double getEigenvectorsMaxNormInf (int mode) const
 Return the maximum infinity norm of the nodes eigenvectors.
 
double normalizeEigenvectors (int mode)
 Normalize the node eigenvectors for the mode argument. More...
 
boost::python::list normalizeEigenvectors (void)
 Normalize the node eigenvectors for all the computed modes. More...
 
void clearEigenvectors (void)
 Remove the stored eigenvectors.
 
- 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 CommandEntity
 CommandEntity (CommandEntity *owr=nullptr)
 Default constructor.
 
CommandEntityOwner (void)
 Return a pointer to the object owner.
 
const CommandEntityOwner (void) const
 Return un puntero al objeto propietario de ESTE.
 
const StandardOutputWrappergetStandardOutputWrapper (void) const
 Return the regular output stream wrapper.
 
StandardOutputWrappergetStandardOutputWrapper (void)
 Return the regular output stream wrapper.
 
const std::string & getLogFileName (void) const
 Returns log file name.
 
void setLogFileName (const std::string &)
 Sets log file name.
 
const std::string & getErrFileName (void) const
 Returns err file name.
 
void setErrFileName (const std::string &)
 Sets error file name.
 
const std::string & getOutputFileName (void) const
 Returns regular output file name.
 
void setOutputFileName (const std::string &)
 Sets regular output file name.
 
boost::python::object evalPy (boost::python::object dict, const std::string &)
 Return the Python object that results from evaluating the argument.
 
boost::python::object execPy (boost::python::object dict, const std::string &)
 Return the Python objects that results from executing the code in the string argument.
 
boost::python::object execFilePy (boost::python::object dict, const std::string &)
 Return the Python object that results from executing the code in the file.
 
- Public Member Functions inherited from EntityWithProperties
 EntityWithProperties (EntityWithProperties *owr=nullptr)
 Default constructor.
 
void clearPyProps (void)
 Clear python properties map.
 
bool hasPyProp (const std::string &)
 Returns true if property exists.
 
boost::python::object getPyProp (const std::string &str)
 Return the Python object with the name being passed as parameter.
 
void setPyProp (std::string str, boost::python::object val)
 Sets/appends a value tho the Python object's dictionary.
 
void copyPropsFrom (const EntityWithProperties &)
 Copy the properties from the argument.
 
boost::python::list getPropNames (void) const
 Return the names of the object properties weightings.
 
const PythonDict & getPropertiesDict (void) const
 Return a std::map container with the properties of the object.
 
boost::python::dict getPyDict (void) const
 Return a Python dictionary containing the object members values.
 
void setPyDict (const boost::python::dict &)
 Set the values of the object members from a Python dictionary.
 
- Public Member Functions inherited from EntityWithOwner
 EntityWithOwner (EntityWithOwner *owr=nullptr)
 Default constructor.
 
 EntityWithOwner (const EntityWithOwner &)
 Copy constructor.
 
EntityWithOwneroperator= (const EntityWithOwner &)
 Assignment operator.
 
virtual bool operator== (const EntityWithOwner &) const
 Comparison operator.
 
virtual ~EntityWithOwner (void)
 Virtual destructor.
 
virtual std::string getClassName (void) const
 Returns demangled class name.
 
void set_owner (EntityWithOwner *owr)
 Assigns the owner of the object.
 
EntityWithOwnerOwner (void)
 
const EntityWithOwnerOwner (void) const
 
- 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 (Communicator &)
 Return the object identifier in the database.
 
void setDbTag (int dbTag)
 Sets the object identifier in the database.
 
void setDbTag (Communicator &)
 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.
 
virtual ~DistributedBase (void)
 Destructor.
 
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.
 
- Static Public Member Functions inherited from CommandEntity
static void resetStandardOutput (void)
 Reset the standard output streams to its defaults buffers.
 
- Static Public Member Functions inherited from EntityWithOwner
static int getVerbosityLevel (void)
 Get the value of the verbosity level.
 
static void setVerbosityLevel (const int &)
 Set the value of the verbosity level.
 

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 (Communicator &)
 Send object members through the communicator argument.
 
int recvData (const Communicator &)
 Receives object members through the communicator argument.
 
- Protected Member Functions inherited from CommandEntity
template<class T >
void string_to (T &, const std::string &) const
 
- Protected Member Functions inherited from EntityWithProperties
bool isEqual (const EntityWithProperties &) const
 Return true if both objects are equal.
 
- Protected Member Functions inherited from EntityWithOwner
virtual bool isEqual (const EntityWithOwner &) const
 Return true if both objects are equal.
 

Friends

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

Additional Inherited Members

- Public Types inherited from EntityWithProperties
typedef std::map< std::string, boost::python::object > PythonDict
 
- Static Protected Member Functions inherited from CommandEntity
static CommandEntityentcmd_cast (boost::any &data)
 
- Static Protected Attributes inherited from EntityWithOwner
static int verbosity = 1
 Object that owns THIS ONE. More...
 

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.

◆ checkNodalReactions()

bool XC::Mesh::checkNodalReactions ( const double &  relTol)

Checks that all free nodes have zero reactions.

Parameters
relTolrelative tolerance with respect to the maximum reaction norm.

◆ 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 MeshComponent from theElements to an 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 &  lockerName)

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

Parameters
lockerNamename for the locker that will prevent the dead nodes to move.

◆ 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 built 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 which 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 &  lockerName)

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

Parameters
lockerNamename for the locker that will prevent the dead nodes to move.

◆ normalizeEigenvectors() [1/2]

double XC::Mesh::normalizeEigenvectors ( int  mode)

Normalize the node eigenvectors for the mode argument.

◆ normalizeEigenvectors() [2/2]

boost::python::list XC::Mesh::normalizeEigenvectors ( void  )

Normalize the node eigenvectors for all the computed modes.

◆ remove() [1/2]

bool XC::Mesh::remove ( Node n)

Removes the the given node.

Parameters
nnode to remove from the mesh.

◆ remove() [2/2]

bool XC::Mesh::remove ( Element e)

Removes the given alement from the mesh.

Parameters
eelement to remove from the mesh.

◆ removeElement()

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

Removes from the domain 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: