OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
|
Set of elements, boundaries, edges and/or nodes. More...
#include <set.h>
Public Member Functions | |
Set (int n, Domain *d) | |
Creates a empty set with given number and belonging to given domain. More... | |
virtual | ~Set () |
virtual IRResultType | initializeFrom (InputRecord *ir) |
Initializes receiver according to object description stored in input record. More... | |
virtual void | giveInputRecord (DynamicInputRecord &input) |
Setups the input record string of receiver. More... | |
const IntArray & | giveElementList () |
Returns list of elements within set. More... | |
const IntArray & | giveBoundaryList () |
Returns list of element boundaries within set. More... | |
const IntArray & | giveEdgeList () |
Returns list of element edges within set (must be edges of 3D elements). More... | |
const IntArray & | giveSurfaceList () |
Returns list of element surfaces within set. More... | |
const IntArray & | giveNodeList () |
Returns list of all nodes within set. More... | |
const IntArray & | giveSpecifiedNodeList () |
Returns list of all directly specified nodes (excluding those generated from elements). More... | |
void | setElementList (IntArray newElements) |
Sets list of elements within set. More... | |
void | setBoundaryList (IntArray newBoundaries) |
Sets list of element boundaries within set. More... | |
void | setEdgeList (IntArray newEdges) |
Sets list of element edges within set (must be edges of 3D elements). More... | |
void | setNodeList (IntArray newNodes) |
Sets list of nodes within set. More... | |
void | clear () |
Clears the entire set. More... | |
void | addAllElements () |
Initialize the element set to contain all elements in the receiver domain. More... | |
bool | hasElement (int elem) const |
Return True if given element is contained. More... | |
virtual void | updateLocalNumbering (EntityRenumberingFunctor &f) |
Local renumbering support. More... | |
void | updateLocalNodeNumbering (EntityRenumberingFunctor &f) |
Renumbering of nodes (could change due to load balancing). More... | |
void | updateLocalElementNumbering (EntityRenumberingFunctor &f) |
Renumbering of nodes (could change due to load balancing). More... | |
virtual contextIOResultType | saveContext (DataStream &stream, ContextMode mode, void *obj=NULL) |
Stores receiver state to output stream. More... | |
virtual contextIOResultType | restoreContext (DataStream &stream, ContextMode mode, void *obj=NULL) |
Restores the receiver state previously written in stream. More... | |
virtual const char * | giveClassName () const |
virtual const char * | giveInputRecordName () const |
Public Member Functions inherited from oofem::FEMComponent | |
FEMComponent (int n, Domain *d) | |
Regular constructor, creates component with given number and belonging to given domain. More... | |
virtual | ~FEMComponent () |
Virtual destructor. More... | |
Domain * | giveDomain () const |
virtual void | setDomain (Domain *d) |
Sets associated Domain. More... | |
int | giveNumber () const |
void | setNumber (int num) |
Sets number of receiver. More... | |
virtual int | checkConsistency () |
Allows programmer to test some internal data, before computation begins. More... | |
virtual void | printOutputAt (FILE *file, TimeStep *tStep) |
Prints output of receiver to stream, for given time step. More... | |
virtual void | printYourself () |
Prints receiver state on stdout. Useful for debugging. More... | |
virtual Interface * | giveInterface (InterfaceType t) |
Interface requesting service. More... | |
std::string | errorInfo (const char *func) const |
Returns string for prepending output (used by error reporting macros). More... | |
Protected Member Functions | |
void | computeIntArray (IntArray &answer, const IntArray &specified, std::list< Range >ranges) |
Converts list ranges to list of individual values + individually specified values. More... | |
Protected Attributes | |
IntArray | elements |
Element numbers. More... | |
bool | mElementListIsSorted |
IntArray | mElementsSorted |
IntArray | elementBoundaries |
IntArray | elementEdges |
Element numbers + boundary numbers (interleaved). More... | |
IntArray | elementSurfaces |
Element numbers + edge numbers (interleaved). More... | |
IntArray | nodes |
Element numbers + surface numbers (interleaved). More... | |
IntArray | totalNodes |
Unique set of nodes (computed). More... | |
Protected Attributes inherited from oofem::FEMComponent | |
int | number |
Component number. More... | |
Domain * | domain |
Link to domain object, useful for communicating with other FEM components. More... | |
Set of elements, boundaries, edges and/or nodes.
Describes a collection of components which are given easy access to for example boundary conditions.
|
inline |
void oofem::Set::addAllElements | ( | ) |
Initialize the element set to contain all elements in the receiver domain.
Definition at line 212 of file set.C.
References elements, oofem::IntArray::enumerate(), oofem::FEMComponent::giveDomain(), and mElementListIsSorted.
Referenced by oofem::ZZErrorEstimator::estimateError(), oofem::SmoothedNodalInternalVariableField::evaluateAt(), oofem::InternalVariableField::evaluateAt(), oofem::VTKExportModule::exportIntVarAs(), oofem::VTKExportModule::getDofManPrimaryVariable(), and oofem::ExportModule::initializeElementSet().
void oofem::Set::clear | ( | ) |
Clears the entire set.
Definition at line 228 of file set.C.
References oofem::IntArray::clear(), elementBoundaries, elementEdges, elements, nodes, and totalNodes.
Referenced by oofem::ExportModule::initializeElementSet().
|
protected |
Converts list ranges to list of individual values + individually specified values.
Definition at line 113 of file set.C.
References oofem::IntArray::at(), oofem::IntArray::findNonzeros(), oofem::IntArray::giveSize(), oofem::IntArray::maximum(), and oofem::IntArray::zero().
Referenced by initializeFrom().
const IntArray & oofem::Set::giveBoundaryList | ( | ) |
Returns list of element boundaries within set.
Boundaries are either surfaces (3d), edges (2d), or corners (1d).
Definition at line 140 of file set.C.
References elementBoundaries.
Referenced by oofem::PrescribedGradientBCNeumann::assembleVector(), oofem::TransportGradientNeumann::assembleVector(), oofem::SolutionbasedShapeFunction::computeCorrectionFactors(), oofem::TransportGradientNeumann::computeEta(), oofem::TransportGradientDirichlet::computeXi(), oofem::TransportGradientDirichlet::domainSize(), oofem::PrescribedGradientBCWeak::findCrackBndIntersecCoord(), oofem::PrescribedGradientBCWeak::findHoleCoord(), oofem::PrescribedGradientBCWeak::giveBoundaries(), giveInputRecord(), oofem::SolutionbasedShapeFunction::initializeSurfaceData(), and oofem::WeakPeriodicBoundaryCondition::updateSminmax().
|
inlinevirtual |
Implements oofem::FEMComponent.
const IntArray & oofem::Set::giveEdgeList | ( | ) |
Returns list of element edges within set (must be edges of 3D elements).
Definition at line 142 of file set.C.
References elementEdges.
Referenced by giveInputRecord().
const IntArray & oofem::Set::giveElementList | ( | ) |
Returns list of elements within set.
Definition at line 138 of file set.C.
References elements.
Referenced by oofem::NeumannMomentLoad::computeXbar(), oofem::SPRNodalRecoveryModel::determinePatchAssemblyPoints(), oofem::SPRNodalRecoveryModel::determinePatchType(), oofem::VTKXMLExportModule::doOutput(), oofem::VTKXMLExportModule::exportIntVarsInGpAs(), oofem::Delamination::findInitiationFronts(), giveInputRecord(), oofem::XfemManager::initiateFronts(), oofem::SPRNodalRecoveryModel::initPatch(), oofem::QuasicontinuumVTKXMLExportModule::initRegionNodeNumbering(), oofem::NodalRecoveryModel::initRegionNodeNumbering(), oofem::VTKXMLExportModule::initRegionNodeNumbering(), oofem::EngngModel::outputElements(), oofem::Delamination::propagateFronts(), oofem::NodalAveragingRecoveryModel::recoverValues(), oofem::ZZNodalRecoveryModel::recoverValues(), oofem::QuasicontinuumVTKXMLExportModule::setupVTKPiece(), and oofem::VTKXMLExportModule::setupVTKPiece().
|
virtual |
Setups the input record string of receiver.
input | Dynamic input record to be filled by receiver. |
Reimplemented from oofem::FEMComponent.
Definition at line 91 of file set.C.
References _IFT_Set_elementBoundaries, _IFT_Set_elementEdges, _IFT_Set_elements, _IFT_Set_elementSurfaces, _IFT_Set_Name, _IFT_Set_nodes, elementBoundaries, elementEdges, elements, elementSurfaces, giveBoundaryList(), giveEdgeList(), giveElementList(), giveNodeList(), oofem::FEMComponent::giveNumber(), giveSurfaceList(), nodes, oofem::DynamicInputRecord::setField(), and oofem::DynamicInputRecord::setRecordKeywordField().
|
inlinevirtual |
Implements oofem::FEMComponent.
Definition at line 165 of file set.h.
References _IFT_Set_Name.
const IntArray & oofem::Set::giveNodeList | ( | ) |
Returns list of all nodes within set.
This list is computed automatically, based on all elements, boundaries, edges, and specified nodes within the set.
Definition at line 146 of file set.C.
References oofem::IntArray::at(), oofem::FEInterpolation::boundaryEdgeGiveNodes(), oofem::FEInterpolation::boundaryGiveNodes(), oofem::FEInterpolation::boundarySurfaceGiveNodes(), oofem::FEMComponent::domain, elementBoundaries, elementEdges, elements, elementSurfaces, oofem::IntArray::findNonzeros(), oofem::Domain::giveElement(), oofem::Element::giveInterpolation(), oofem::Element::giveNode(), oofem::FEMComponent::giveNumber(), oofem::Domain::giveNumberOfDofManagers(), oofem::Element::giveNumberOfNodes(), oofem::IntArray::giveSize(), nodes, totalNodes, and oofem::IntArray::zero().
Referenced by oofem::TransportGradientDirichlet::computeXi(), oofem::PrescribedGradientBCPeriodic::findSlaveToMasterMap(), oofem::TransportGradientPeriodic::findSlaveToMasterMap(), giveInputRecord(), and oofem::EngngModel::outputNodes().
const IntArray & oofem::Set::giveSpecifiedNodeList | ( | ) |
Returns list of all directly specified nodes (excluding those generated from elements).
This list is exactly the list given in the input.
Definition at line 202 of file set.C.
References nodes.
const IntArray & oofem::Set::giveSurfaceList | ( | ) |
Returns list of element surfaces within set.
Definition at line 144 of file set.C.
References elementSurfaces.
Referenced by giveInputRecord().
bool oofem::Set::hasElement | ( | int | elem | ) | const |
Return True if given element is contained.
Definition at line 218 of file set.C.
References oofem::IntArray::begin(), elements, oofem::IntArray::end(), mElementListIsSorted, mElementsSorted, oofem::FEMComponent::number, and oofem::IntArray::sort().
Referenced by oofem::MMALeastSquareProjection::__init(), oofem::SPRNodalRecoveryModel::determinePatchAssemblyPoints(), oofem::OctreeSpatialLocalizer::giveClosestIP(), oofem::OctreeSpatialLocalizer::giveClosestIPWithinOctant(), oofem::OctreeSpatialLocalizer::giveElementContainingPoint(), and oofem::SPRNodalRecoveryModel::initPatch().
|
virtual |
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.
ir | Input record to initialize from. |
Reimplemented from oofem::FEMComponent.
Definition at line 51 of file set.C.
References _IFT_Set_allElements, _IFT_Set_allNodes, _IFT_Set_elementBoundaries, _IFT_Set_elementEdges, _IFT_Set_elementRanges, _IFT_Set_elements, _IFT_Set_elementSurfaces, _IFT_Set_nodeRanges, _IFT_Set_nodes, oofem::IntArray::clear(), computeIntArray(), elementBoundaries, elementEdges, elements, elementSurfaces, oofem::IntArray::enumerate(), oofem::FEMComponent::giveDomain(), oofem::InputRecord::hasField(), oofem::FEMComponent::initializeFrom(), IR_GIVE_OPTIONAL_FIELD, mElementListIsSorted, and nodes.
|
virtual |
Restores the receiver state previously written in stream.
stream | Input stream. |
mode | Determines amount of info available in stream (state, definition, ...). |
obj | Special parameter for sending extra information. |
throws | an ContextIOERR exception if error encountered. |
Reimplemented from oofem::FEMComponent.
Definition at line 293 of file set.C.
References oofem::CIO_OK, oofem::IntArray::clear(), CM_Definition, elementBoundaries, elementEdges, elements, nodes, oofem::FEMComponent::restoreContext(), oofem::IntArray::restoreYourself(), THROW_CIOERR, and totalNodes.
|
virtual |
Stores receiver state to output stream.
stream | Output stream. |
mode | Determines amount of info required in stream (state, definition, ...). |
obj | Special parameter, used only to send particular integration point to material class version of this method. |
throws | an ContextIOERR exception if error encountered. |
Reimplemented from oofem::FEMComponent.
Definition at line 267 of file set.C.
References oofem::CIO_OK, CM_Definition, elementBoundaries, elementEdges, elements, nodes, oofem::FEMComponent::saveContext(), oofem::IntArray::storeYourself(), and THROW_CIOERR.
void oofem::Set::setBoundaryList | ( | IntArray | newBoundaries | ) |
Sets list of element boundaries within set.
Definition at line 206 of file set.C.
References elementBoundaries.
void oofem::Set::setEdgeList | ( | IntArray | newEdges | ) |
Sets list of element edges within set (must be edges of 3D elements).
Definition at line 208 of file set.C.
References elementEdges.
Referenced by oofem::TransportGradientDirichlet::computeXi().
void oofem::Set::setElementList | ( | IntArray | newElements | ) |
Sets list of elements within set.
Definition at line 204 of file set.C.
References elements, and mElementListIsSorted.
Referenced by oofem::Element::mapStateVariables(), oofem::MDM::MMI_map(), and oofem::IsotropicDamageMaterial1::MMI_map().
void oofem::Set::setNodeList | ( | IntArray | newNodes | ) |
void oofem::Set::updateLocalElementNumbering | ( | EntityRenumberingFunctor & | f | ) |
Renumbering of nodes (could change due to load balancing).
Definition at line 250 of file set.C.
References oofem::IntArray::at(), elementBoundaries, elementEdges, elements, oofem::ERS_Element, oofem::IntArray::giveSize(), and mElementListIsSorted.
Referenced by updateLocalNumbering().
void oofem::Set::updateLocalNodeNumbering | ( | EntityRenumberingFunctor & | f | ) |
Renumbering of nodes (could change due to load balancing).
Definition at line 243 of file set.C.
References oofem::IntArray::at(), oofem::ERS_DofManager, oofem::IntArray::giveSize(), and nodes.
Referenced by updateLocalNumbering().
|
virtual |
Local renumbering support.
For some tasks (parallel load balancing, for example) it is necessary to renumber the entities. The various FEM components (such as nodes or elements) typically contain links to other entities in terms of their local numbers, etc. This service allows to update these relations to reflect updated numbering. The renumbering function is passed, which is supposed to return an updated number of specified entity type based on old number.
Reimplemented from oofem::FEMComponent.
Definition at line 237 of file set.C.
References updateLocalElementNumbering(), and updateLocalNodeNumbering().
|
protected |
Definition at line 72 of file set.h.
Referenced by clear(), giveBoundaryList(), giveInputRecord(), giveNodeList(), initializeFrom(), restoreContext(), saveContext(), setBoundaryList(), and updateLocalElementNumbering().
|
protected |
Element numbers + boundary numbers (interleaved).
Definition at line 73 of file set.h.
Referenced by clear(), giveEdgeList(), giveInputRecord(), giveNodeList(), initializeFrom(), restoreContext(), saveContext(), setEdgeList(), and updateLocalElementNumbering().
|
protected |
Element numbers.
Definition at line 69 of file set.h.
Referenced by addAllElements(), clear(), giveElementList(), giveInputRecord(), giveNodeList(), hasElement(), initializeFrom(), restoreContext(), saveContext(), setElementList(), and updateLocalElementNumbering().
|
protected |
Element numbers + edge numbers (interleaved).
Definition at line 74 of file set.h.
Referenced by giveInputRecord(), giveNodeList(), giveSurfaceList(), and initializeFrom().
|
mutableprotected |
Definition at line 70 of file set.h.
Referenced by addAllElements(), hasElement(), initializeFrom(), setElementList(), and updateLocalElementNumbering().
|
mutableprotected |
Definition at line 71 of file set.h.
Referenced by hasElement().
|
protected |
Element numbers + surface numbers (interleaved).
Node numbers.
Definition at line 75 of file set.h.
Referenced by clear(), giveInputRecord(), giveNodeList(), giveSpecifiedNodeList(), initializeFrom(), restoreContext(), saveContext(), setNodeList(), and updateLocalNodeNumbering().
|
protected |
Unique set of nodes (computed).
Definition at line 76 of file set.h.
Referenced by clear(), giveNodeList(), and restoreContext().