OOFEM 3.0
Loading...
Searching...
No Matches
oofem::Node Class Reference

#include <node.h>

Inheritance diagram for oofem::Node:
Collaboration diagram for oofem::Node:

Public Member Functions

 Node (int n, Domain *aDomain)
void setCoordinates (FloatArray coords)
virtual double giveUpdatedCoordinate (int ic, TimeStep *tStep, double scale=1.)
virtual void giveUpdatedCoordinates (FloatArray &answer, TimeStep *tStep, double scale=1.)
bool hasLocalCS ()
 Returns nonzero if node has prescribed local coordinate system.
FloatMatrixgiveLocalCoordinateTriplet ()
bool hasSameLCS (Node *remote)
bool computeL2GTransformation (FloatMatrix &answer, const IntArray &dofIDArry) override
bool requiresTransformation () override
void computeLoadVector (FloatArray &answer, Load *load, CharType type, TimeStep *tStep, ValueModeType mode) override
void updateYourself (TimeStep *tStep) override
const char * giveClassName () const override
const char * giveInputRecordName () const override
void initializeFrom (InputRecord &ir) override
void initializeFrom (InputRecord &ir, int priority) override
void initializeFinish () override
 Performs post initialization steps.
void giveInputRecord (DynamicInputRecord &input) override
void printYourself () override
 Prints receiver state on stdout. Useful for debugging.
int checkConsistency () override
bool isDofTypeCompatible (dofType type) const override
 Returns true if dof of given type is allowed to be associated to receiver.
virtual int giveQcNodeType ()
void saveContext (DataStream &stream, ContextMode mode) override
void restoreContext (DataStream &stream, ContextMode mode) override
void drawYourself (oofegGraphicContext &gc, TimeStep *tStep) override
Public Member Functions inherited from oofem::DofManager
std::vector< Dof * >::iterator begin ()
std::vector< Dof * >::iterator end ()
std::vector< Dof * >::const_iterator begin () const
std::vector< Dof * >::const_iterator end () const
 DofManager (int n, Domain *aDomain)
virtual ~DofManager ()
 Destructor.
DofgiveDofWithID (int dofID) const
int giveNumberOfDofs () const
void askNewEquationNumbers (TimeStep *tStep)
 Renumbers all contained DOFs.
int giveNumberOfPrimaryMasterDofs (const IntArray &dofIDArray) const
void giveLocationArray (const IntArray &dofIDArry, IntArray &locationArray, const UnknownNumberingScheme &s) const
void giveMasterDofIDArray (const IntArray &dofIDArry, IntArray &masterDofIDs) const
void giveCompleteLocationArray (IntArray &locationArray, const UnknownNumberingScheme &s) const
void giveCompleteMasterDofIDArray (IntArray &dofIDArray) const
std::vector< Dof * >::const_iterator findDofWithDofId (DofIDItem dofID) const
void giveUnknownVector (FloatArray &answer, const IntArray &dofMask, ValueModeType mode, TimeStep *tStep, bool padding=false)
void giveUnknownVector (FloatArray &answer, const IntArray &dofMask, PrimaryField &field, ValueModeType mode, TimeStep *tStep, bool padding=false)
void giveCompleteUnknownVector (FloatArray &answer, ValueModeType mode, TimeStep *tStep)
void giveUnknownVectorOfType (FloatArray &answer, UnknownType ut, ValueModeType mode, TimeStep *tStep)
virtual void givePrescribedUnknownVector (FloatArray &answer, const IntArray &dofMask, ValueModeType mode, TimeStep *tStep)
bool computeM2GTransformation (FloatMatrix &answer, const IntArray &dofIDArry)
virtual bool computeM2LTransformation (FloatMatrix &answer, const IntArray &dofIDArry)
IntArraygiveLoadArray ()
void setLoadArray (IntArray &load)
double giveCoordinate (int i) const
const FloatArraygiveCoordinates () const
void setCoordinates (const FloatArray &coords)
 Set coordinates.
const IntArraygiveForcedDofIDs ()
std ::map< int, int > * giveDofTypeMap ()
std ::map< int, int > * giveMasterMap ()
std ::map< int, int > * giveBcMap ()
std ::map< int, int > * giveIcMap ()
void printOutputAt (FILE *file, TimeStep *tStep) override
bool isBoundary ()
void setBoundaryFlag (bool isBoundary)
virtual bool hasAnySlaveDofs ()
virtual bool giveMasterDofMans (IntArray &masters)
void postInitialize () override
 Performs post initialization steps. Called after all components are created and initialized.
void updateLocalNumbering (EntityRenumberingFunctor &f) override
void setNumberOfDofs (int _ndofs)
void appendDof (Dof *dof)
void removeDof (DofIDItem id)
bool hasDofID (DofIDItem id) const
int giveGlobalNumber () const
int giveLabel () const
void setGlobalNumber (int newNumber)
dofManagerParallelMode giveParallelMode () const
void setParallelMode (dofManagerParallelMode _mode)
const IntArraygivePartitionList ()
void setPartitionList (const IntArray *_p)
void removePartitionFromList (int _part)
 Removes given partition from receiver list.
void mergePartitionList (IntArray &_p)
 Merges receiver partition list with given lists.
int givePartitionsConnectivitySize ()
bool isLocal ()
 Returns true if receiver is locally maintained.
bool isShared ()
 Returns true if receiver is shared.
bool isNull ()
 Returns true if receiver is shared.
Public Member Functions inherited from oofem::FEMComponent
 FEMComponent (int n, Domain *d)
virtual ~FEMComponent ()=default
 Virtual destructor.
DomaingiveDomain () const
virtual void setDomain (Domain *d)
int giveNumber () const
void setNumber (int num)
virtual InterfacegiveInterface (InterfaceType t)
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros).

Protected Attributes

std::unique_ptr< FloatMatrixlocalCoordinateSystem
Protected Attributes inherited from oofem::DofManager
FloatArray coordinates
 Array storing nodal coordinates.
std::vector< Dof * > dofArray
 Array of DOFs.
IntArray loadArray
 List of applied loads.
bool isBoundaryFlag
bool hasSlaveDofs
 Flag indicating whether receiver has slave DOFs.
int globalNumber
dofManagerParallelMode parallel_mode
IntArray partitions
IntArray dofidmask
 List of additional dof ids to include.
std ::map< int, int > dofTypemap
 Map from DofIDItem to dofType.
std ::map< int, int > dofMastermap
 Map from DofIDItem to master node.
std ::map< int, int > dofBCmap
 Map from DofIDItem to bc (to be removed).
std ::map< int, int > dofICmap
 Map from DofIDItem to ic (to be removed).
IntArray mBC
Protected Attributes inherited from oofem::FEMComponent
int number
 Component number.
Domaindomain
 Link to domain object, useful for communicating with other FEM components.

Static Protected Attributes

static ParamKey IPK_Node_lcs
static ParamKey IPK_Node_coords

Additional Inherited Members

Static Public Attributes inherited from oofem::DofManager
static ParamKey IPK_DofManager_dofidmask
static ParamKey IPK_DofManager_load
static ParamKey IPK_DofManager_bc
static ParamKey IPK_DofManager_ic
static ParamKey IPK_DofManager_mastermask
static ParamKey IPK_DofManager_doftypemask
static ParamKey IPK_DofManager_boundaryflag
static ParamKey IPK_DofManager_globnum
static ParamKey IPK_DofManager_partitions
static ParamKey IPK_DofManager_sharedflag
static ParamKey IPK_DofManager_remoteflag
static ParamKey IPK_DofManager_nullflag

Detailed Description

Class implementing node in finite element mesh. Node possess degrees of freedom (see base class DofManager). Node is attribute of few elements and it is managed by domain. Node manages its position in space, and if specified local coordinate system in node. If local coordinate system is defined, all equilibrium equations are assembled in this system and therefore all DOFs and applied boundary and initial conditions apply in this local coordinate system. By default, global coordinate system is assumed in each node. For description, how to prescribe local coordinate system in node, see input file description section.

Tasks include:

  • Managing its position in space. In geometrically linear analysis, this only amounts to managing its coordinates.
  • Managing its local coordinate system. If it is defined, all equilibrium equations are assembled within it. This system is defined by triplet of unit vectors of local coordinates expressed in terms of global axes. This tripled is stored in localCoordinateSystem, its item ij is angle between e'(i) and e(j), where e' is local axis.
  • Managing its degrees of freedom (method giveDof) ;
  • Calculating its nodal load vector;
  • Printing and updating at end of step ;
  • Managing its swapping to and from disk.

Definition at line 91 of file node.h.

Constructor & Destructor Documentation

◆ Node()

Member Function Documentation

◆ checkConsistency()

int oofem::Node::checkConsistency ( void )
overridevirtual

Allows programmer to test some internal data, before computation begins. For example, one may use this function, to ensure that element has material with required capabilities is assigned to element. This must be done after all mesh components are instanciated.

Returns
Nonzero if receiver is consistent.

Reimplemented from oofem::FEMComponent.

Reimplemented in oofem::PFEMParticle, oofem::qcNode, and oofem::RigidArmNode.

Definition at line 313 of file node.C.

References oofem::IntArray::at(), oofem::FEMComponent::domain, oofem::SimpleSlaveDof::giveMasterDofManagerNum(), hasSameLCS(), Node(), and OOFEM_WARNING.

◆ computeL2GTransformation()

bool oofem::Node::computeL2GTransformation ( FloatMatrix & answer,
const IntArray & dofIDArry )
overridevirtual

Computes transformation matrix from global c.s. to DOF-manager specific c.s; \( u_g = Q\cdot u_l \).

Parameters
answerComputed transformation matrix.
dofIDArryArray containing DofIDItem-type values for which transformation matrix is assembled. If dofIDArry is NULL, then all receiver DOFs are assumed.
Returns
True is transformation is needed, false otherwise.
Todo
This relies on the order of the dofs, not good.. / Mikael

Reimplemented from oofem::DofManager.

Definition at line 412 of file node.C.

References oofem::__DofIDItemToString(), oofem::FloatMatrix::at(), oofem::IntArray::at(), oofem::FloatMatrix::clear(), oofem::Dof::giveDofID(), oofem::DofManager::giveNumberOfDofs(), oofem::IntArray::giveSize(), oofem::IntArray::isEmpty(), localCoordinateSystem, OOFEM_ERROR, oofem::FloatMatrix::resize(), and oofem::FloatMatrix::zero().

Referenced by computeLoadVector(), oofem::RigidArmNode::computeMasterContribution(), drawYourself(), oofem::InteractionPFEMParticle::givePrescribedUnknownVector(), and oofem::LatticeDirichletCouplingNode::giveUnknownVector().

◆ computeLoadVector()

void oofem::Node::computeLoadVector ( FloatArray & answer,
Load * load,
CharType type,
TimeStep * tStep,
ValueModeType mode )
overridevirtual

Computes the load vector for given load.

Parameters
answerLoad vector for given load.
loadGiven load.
typeCharacteristic type of the vector.
tStepTime step when answer is computed.
modeDetermines response mode.

Reimplemented from oofem::DofManager.

Definition at line 167 of file node.C.

References oofem::FloatArray::clear(), oofem::Load::computeComponentArrayAt(), computeL2GTransformation(), oofem::NodalLoad::giveBCGeoType(), oofem::NodalLoad::giveCoordSystMode(), oofem::GeneralBoundaryCondition::giveDofIDs(), oofem::NodalLoadBGT, OOFEM_ERROR, and oofem::FloatArray::rotatedWith().

Referenced by oofem::LatticeNeumannCouplingNode::computeLoadVectorAt(), and drawYourself().

◆ drawYourself()

◆ giveClassName()

const char * oofem::Node::giveClassName ( ) const
inlineoverridevirtual
Returns
Class name of the receiver.

Reimplemented from oofem::DofManager.

Reimplemented in oofem::Particle, oofem::PFEMParticle, oofem::qcNode, oofem::RigidArmNode, and oofem::SlaveNode.

Definition at line 167 of file node.h.

◆ giveInputRecord()

void oofem::Node::giveInputRecord ( DynamicInputRecord & input)
overridevirtual

Setups the input record string of receiver.

Parameters
inputDynamic input record to be filled by receiver.

Reimplemented from oofem::DofManager.

Definition at line 154 of file node.C.

References _IFT_Node_coords, _IFT_Node_lcs, oofem::DofManager::coordinates, localCoordinateSystem, and oofem::DynamicInputRecord::setField().

◆ giveInputRecordName()

const char * oofem::Node::giveInputRecordName ( ) const
inlineoverridevirtual
Returns
Input record name of the receiver.

Reimplemented from oofem::DofManager.

Reimplemented in oofem::Particle, oofem::PFEMParticle, oofem::qcNode, oofem::RigidArmNode, and oofem::SlaveNode.

Definition at line 168 of file node.h.

References _IFT_Node_Name.

◆ giveLocalCoordinateTriplet()

FloatMatrix * oofem::Node::giveLocalCoordinateTriplet ( )
inline

Returns pointer to local coordinate triplet in node. If not defined, returns NULL.

Returns
Triplet defining the local coordinate system in node. Value at position (i,j) represents angle between e'(i) and e(j), where e' is base vector of local coordinate system and e is base vector of global c.s.

Definition at line 149 of file node.h.

References localCoordinateSystem.

Referenced by drawYourself(), oofem::VTKExportModule::exportPrimVarAs(), oofem::VTKBaseExportModule::getNodalVariableFromPrimaryField(), oofem::RefinedElement::giveCompatibleBcDofArray(), giveUpdatedCoordinate(), hasSameLCS(), oofem::HuertaErrorEstimatorInterface::setupRefinedElementProblem1D(), oofem::HuertaErrorEstimatorInterface::setupRefinedElementProblem2D(), and oofem::HuertaErrorEstimatorInterface::setupRefinedElementProblem3D().

◆ giveQcNodeType()

virtual int oofem::Node::giveQcNodeType ( )
inlinevirtual

◆ giveUpdatedCoordinate()

double oofem::Node::giveUpdatedCoordinate ( int ic,
TimeStep * tStep,
double scale = 1. )
virtual

Returns updated ic-th coordinate of receiver. Return value is computed as coordinate + scale * displacement, where corresponding displacement is obtained from corresponding nodal DOF. Local coordinate system is taken into account. Useful mainly for postprocessing.

Parameters
icIndex of coordinate.
tStepTime step for the displacement.
scaleScaling of displacement.

Definition at line 234 of file node.C.

References oofem::FloatArray::at(), oofem::FloatMatrix::at(), oofem::DofManager::giveCoordinate(), oofem::Dof::giveDofID(), giveLocalCoordinateTriplet(), oofem::FloatMatrix::giveNumberOfRows(), oofem::TimeStep::giveTimeIncrement(), oofem::Dof::giveUnknown(), hasLocalCS(), oofem::TimeStep::isTheCurrentTimeStep(), OOFEM_ERROR, and oofem::FloatArray::zero().

Referenced by oofem::CCTPlate::drawDeformedGeometry(), oofem::CohesiveSurface3d::drawDeformedGeometry(), oofem::DKTPlate::drawDeformedGeometry(), oofem::LIBeam2dNL::drawDeformedGeometry(), oofem::LIBeam3d2::drawDeformedGeometry(), oofem::LIBeam3dNL2::drawDeformedGeometry(), oofem::LIBeam3dNL::drawDeformedGeometry(), oofem::QDKTPlate::drawDeformedGeometry(), oofem::Truss1d::drawDeformedGeometry(), oofem::Truss2d::drawDeformedGeometry(), oofem::Truss3d::drawDeformedGeometry(), oofem::CCTPlate::drawScalar(), oofem::CohesiveSurface3d::drawScalar(), oofem::DKTPlate::drawScalar(), oofem::LIBeam3d2::drawScalar(), oofem::QDKTPlate::drawScalar(), oofem::Truss1d::drawScalar(), oofem::VTKExportModule::exportIntVarAs(), oofem::VTKBaseExportModule::getNodalVariableFromIS(), and oofem::StructuralElement::giveInternalStateAtNode().

◆ giveUpdatedCoordinates()

void oofem::Node::giveUpdatedCoordinates ( FloatArray & answer,
TimeStep * tStep,
double scale = 1. )
virtual

Returns updated coordinate of receiver. Return value is computed as coordinate + scale * displacement, where corresponding displacement is obtained from corresponding nodal DOF. Local coordinate system is taken into account and the answer is given in global coordinates.

Parameters
answerUpdated coordinate.
tStepTime step for the displacement.
scaleScaling of displacement.

Definition at line 296 of file node.C.

References oofem::FloatArray::at(), oofem::DofManager::coordinates, oofem::FloatArray::giveSize(), oofem::DofManager::giveUnknownVectorOfType(), and oofem::TimeStep::isTheCurrentTimeStep().

◆ hasLocalCS()

bool oofem::Node::hasLocalCS ( )
inline

◆ hasSameLCS()

bool oofem::Node::hasSameLCS ( Node * remote)

Returns true, if the local coordinate systems of receiver and given node are the same

Definition at line 375 of file node.C.

References oofem::FloatMatrix::at(), giveLocalCoordinateTriplet(), hasLocalCS(), and Node().

Referenced by oofem::HangingNode::checkConsistency(), checkConsistency(), and oofem::qcNode::checkConsistency().

◆ initializeFinish()

void oofem::Node::initializeFinish ( )
overridevirtual

Performs post initialization steps.

Reimplemented from oofem::DofManager.

Definition at line 144 of file node.C.

References oofem::FEMComponent::giveDomain(), IPK_Node_coords, oofem::FEMComponent::number, and PM_DOFMAN_ERROR_IFNOTSET.

Referenced by oofem::GeneralSlaveNode::initializeFinish().

◆ initializeFrom() [1/2]

void oofem::Node::initializeFrom ( InputRecord & ir)
inlineoverridevirtual

Initializes receiver according to object description stored in input record. This function is called immediately after creating object using constructor. Input record can be imagined as data record in component database belonging to receiver. Receiver may use value-name extracting functions to extract particular field from record. Note that initializeFrom may be called mutiple times.

See also
IR_GIVE_FIELD
IR_GIVE_OPTIONAL_FIELD
Parameters
irInput record to initialize from.
priorityPriority of the input record. This is used to determine the order of initialization

Reimplemented from oofem::DofManager.

Definition at line 169 of file node.h.

References initializeFrom().

Referenced by oofem::GeneralSlaveNode::initializeFrom(), and initializeFrom().

◆ initializeFrom() [2/2]

◆ isDofTypeCompatible()

bool oofem::Node::isDofTypeCompatible ( dofType type) const
inlineoverridevirtual

Returns true if dof of given type is allowed to be associated to receiver.

Reimplemented from oofem::DofManager.

Reimplemented in oofem::qcNode, oofem::RigidArmNode, and oofem::SlaveNode.

Definition at line 176 of file node.h.

◆ printYourself()

void oofem::Node::printYourself ( )
overridevirtual

Prints receiver state on stdout. Useful for debugging.

Reimplemented from oofem::DofManager.

Definition at line 196 of file node.C.

References oofem::DofManager::giveCoordinate(), oofem::DofManager::loadArray, oofem::FEMComponent::number, and oofem::Dof::printYourself().

◆ requiresTransformation()

bool oofem::Node::requiresTransformation ( )
inlineoverridevirtual

Indicates, whether dofManager requires the transformation.

Returns
Nonzero if transformation is necessary, even for single dof.

Reimplemented from oofem::DofManager.

Definition at line 154 of file node.h.

References hasLocalCS(), and oofem::DofManager::hasSlaveDofs.

◆ restoreContext()

void oofem::Node::restoreContext ( DataStream & stream,
ContextMode mode )
overridevirtual

Restores the receiver state previously written in stream.

See also
saveContext
Parameters
streamInput stream.
modeDetermines amount of info available in stream (state, definition, ...).
Exceptions
throwsan ContextIOERR exception if error encountered.
Todo
Smart pointers would be nicer here

Reimplemented from oofem::DofManager.

Definition at line 578 of file node.C.

References oofem::CIO_IOERR, oofem::CIO_OK, CM_Definition, oofem::DofManager::coordinates, localCoordinateSystem, oofem::DataStream::read(), and THROW_CIOERR.

◆ saveContext()

void oofem::Node::saveContext ( DataStream & stream,
ContextMode mode )
overridevirtual

Stores receiver state to output stream.

Parameters
streamOutput stream.
modeDetermines amount of info required in stream (state, definition, ...).
Exceptions
throwsan ContextIOERR exception if error encountered.

Reimplemented from oofem::DofManager.

Definition at line 553 of file node.C.

References oofem::CIO_IOERR, oofem::CIO_OK, CM_Definition, oofem::DofManager::coordinates, hasLocalCS(), localCoordinateSystem, THROW_CIOERR, and oofem::DataStream::write().

◆ setCoordinates()

void oofem::Node::setCoordinates ( FloatArray coords)
inline

Sets node coordinates to given array.

Parameters
coordsNew coordinates for node.

Definition at line 117 of file node.h.

References oofem::DofManager::coordinates.

Referenced by oofem::Subdivision::createMesh().

◆ updateYourself()

void oofem::Node::updateYourself ( TimeStep * tStep)
overridevirtual

Updates receiver at end of time step (i.e. after equilibrium has been reached). If EngngModel formulation ( see giveFormulation() member function) returns actualized Lagrange mode, receiver updates its coordinates according to solution.

Parameters
tStepTime step for which to update.
See also
EngngModel::giveFormulation

Reimplemented from oofem::DofManager.

Reimplemented in oofem::PFEMParticle.

Definition at line 211 of file node.C.

References oofem::AL, oofem::DofManager::coordinates, oofem::FEMComponent::domain, oofem::Dof::giveDofID(), oofem::TimeStep::giveTimeIncrement(), and oofem::Dof::giveUnknown().

Member Data Documentation

◆ IPK_Node_coords

ParamKey oofem::Node::IPK_Node_coords
staticprotected

Definition at line 103 of file node.h.

Referenced by initializeFinish(), and initializeFrom().

◆ IPK_Node_lcs

ParamKey oofem::Node::IPK_Node_lcs
staticprotected

Definition at line 102 of file node.h.

Referenced by initializeFrom().

◆ localCoordinateSystem

std::unique_ptr<FloatMatrix> oofem::Node::localCoordinateSystem
protected

Triplet defining the local coordinate system in node. Value at position (i,j) represents angle between e'(i) and e(j), where e' is base vector of local coordinate system and e is base vector of global c.s.

Definition at line 100 of file node.h.

Referenced by computeL2GTransformation(), oofem::RigidArmNode::computeMasterContribution(), giveInputRecord(), giveLocalCoordinateTriplet(), hasLocalCS(), initializeFrom(), restoreContext(), and saveContext().


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

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011