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

#include <set.h>

Inheritance diagram for oofem::Set:
Collaboration diagram for oofem::Set:

Public Member Functions

 Set (int n, Domain *d)
virtual ~Set ()
void initializeFrom (InputRecord &ir) override
void giveInputRecord (DynamicInputRecord &input) override
const IntArraygiveElementList ()
const IntArraygiveBoundaryList ()
const IntArraygiveEdgeList ()
const IntArraygiveSurfaceList ()
const IntArraygiveInternalElementDofManagerList ()
const IntArraygiveNodeList ()
const IntArraygiveSpecifiedNodeList ()
void setElementList (IntArray newElements)
void setBoundaryList (IntArray newBoundaries)
void setEdgeList (IntArray newEdges)
void setNodeList (IntArray newNodes)
void clear ()
void addAllElements ()
bool hasElement (int elem) const
 Return True if given element is contained.
std::string giveElementProperties () const
std::string giveDofManProperties () const
void updateLocalNumbering (EntityRenumberingFunctor &f) override
void updateLocalNodeNumbering (EntityRenumberingFunctor &f)
void updateLocalElementNumbering (EntityRenumberingFunctor &f)
void saveContext (DataStream &stream, ContextMode mode) override
void restoreContext (DataStream &stream, ContextMode mode) override
const char * giveClassName () const override
const char * giveInputRecordName () const override
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 void initializeFrom (InputRecord &ir, int priority)
virtual void initializeFinish ()
virtual void postInitialize ()
 Performs post initialization steps. Called after all components are created and initialized.
virtual int checkConsistency ()
virtual void printOutputAt (FILE *file, TimeStep *tStep)
virtual void printYourself ()
 Prints receiver state on stdout. Useful for debugging.
virtual InterfacegiveInterface (InterfaceType t)
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros).

Protected Member Functions

void computeIntArray (IntArray &answer, const IntArray &specified, std ::list< Range >ranges)

Protected Attributes

IntArray elements
 Element numbers.
bool mElementListIsSorted
IntArray mElementsSorted
IntArray elementBoundaries
IntArray elementEdges
 Element numbers + boundary numbers (interleaved).
IntArray elementSurfaces
 Element numbers + edge numbers (interleaved).
IntArray elementInternalNodes
 Element numbers + surface numbers (interleaved).
IntArray nodes
 Element numbers + internal dof manager numbers (interleaved).
IntArray totalNodes
 Unique set of nodes (computed).
std::string elementprops
 Element properties.
std::string dofmanprops
 Dof manager properties.
bool nodalListInitialized = false
Protected Attributes inherited from oofem::FEMComponent
int number
 Component number.
Domaindomain
 Link to domain object, useful for communicating with other FEM components.

Detailed Description

Set of elements, boundaries, edges and/or nodes. Describes a collection of components which are given easy access to for example boundary conditions.

Note
bp: sets are defined using component labels (global numbers). In the initialization, the sets are resolved to local component numbers. In parallel mode (MPI), the sets are resolved to local component numbers on each processor, but set definition is TYPICALLY duplicated on all processors. In turn, the sets are resolved to local component numbers on each processor. As the set definition can contain global component, hat are not present on the processor, these entries are removed from the set during resolution process. To support also dynamic load balancing, the set resolution has to be done after each load balancing step and thus we need to keep the original set definition. This can be achieved by keeping the original input record of the set.
Author
Mikael Öhman

Definition at line 81 of file set.h.

Constructor & Destructor Documentation

◆ Set()

oofem::Set::Set ( int n,
Domain * d )

Creates a empty set with given number and belonging to given domain.

Parameters
nSet number.
dDomain to which component belongs to.

Definition at line 52 of file set.C.

References elementprops, oofem::FEMComponent::FEMComponent(), and mElementListIsSorted.

◆ ~Set()

virtual oofem::Set::~Set ( )
inlinevirtual

Definition at line 110 of file set.h.

Member Function Documentation

◆ addAllElements()

void oofem::Set::addAllElements ( )

◆ clear()

void oofem::Set::clear ( )

Clears the entire set.

Definition at line 255 of file set.C.

References elementBoundaries, elementEdges, elementInternalNodes, elements, nodes, and totalNodes.

Referenced by oofem::DGProblem::constructBoundaryEntities().

◆ computeIntArray()

void oofem::Set::computeIntArray ( IntArray & answer,
const IntArray & specified,
std ::list< Range > ranges )
protected

Converts list ranges to list of individual values + individually specified values.

Definition at line 133 of file set.C.

References oofem::IntArray::at(), oofem::IntArray::findNonzeros(), oofem::IntArray::giveSize(), oofem::IntArray::maximum(), and oofem::IntArray::zero().

Referenced by initializeFrom().

◆ giveBoundaryList()

◆ giveClassName()

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

Implements oofem::FEMComponent.

Definition at line 198 of file set.h.

◆ giveDofManProperties()

std::string oofem::Set::giveDofManProperties ( ) const
inline

Definition at line 182 of file set.h.

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

◆ giveEdgeList()

const IntArray & oofem::Set::giveEdgeList ( )

Returns list of element edges within set (must be edges of 3D elements).

Returns
List of element edges.

Definition at line 162 of file set.C.

References elementEdges.

Referenced by oofem::EngngModel::assemble(), oofem::EngngModel::assembleVectorFromBC(), giveInputRecord(), and oofem::BCTracker::initialize().

◆ giveElementList()

const IntArray & oofem::Set::giveElementList ( )

Returns list of elements within set.

Returns
List of element numbers.

Definition at line 158 of file set.C.

References elements.

Referenced by oofem::EngngModel::assemble(), oofem::TransverseReinfConstraint::assemble(), oofem::Integral::assemble_lhs(), oofem::Integral::assemble_rhs(), oofem::PrescribedDispSlipBCNeumannRC::assembleOnReinfStress(), oofem::PrescribedDispSlipBCNeumannRC::assembleOnTransferStress(), oofem::TransverseReinfConstraint::assembleVector(), oofem::PrescribedDispSlipBCNeumannRC::assembleVectorBStress(), oofem::EngngModel::assembleVectorFromBC(), oofem::PrescribedDispSlipBCNeumannRC::assembleVectorRStress(), oofem::PrescribedDispSlipBCNeumannRC::computeInterfaceLength(), oofem::PrescribedDispSlipBCNeumannRC::computeWeightMatrix(), oofem::SPRNodalRecoveryModel::determinePatchAssemblyPoints(), oofem::SPRNodalRecoveryModel::determinePatchType(), oofem::MatlabExportModule::doOutputIntegrationPointFields(), oofem::VTKBaseExportModule::exportCellVars(), oofem::VTKBaseExportModule::exportSetMembership(), giveInputRecord(), oofem::PrescribedDispSlipBCNeumannRC::giveLocationArrays(), oofem::TransverseReinfConstraint::giveLocationArrays(), oofem::BCTracker::initialize(), oofem::Integral::initialize(), oofem::Domain::initializeFinish(), oofem::XfemManager::initiateFronts(), oofem::SPRNodalRecoveryModel::initPatch(), oofem::NodalRecoveryModel::initRegionNodeNumbering(), oofem::QuasicontinuumVTKXMLExportModule::initRegionNodeNumbering(), oofem::VTKBaseExportModule::initRegionNodeNumbering(), oofem::VTKXMLLatticeExportModule::initRegionNodeNumbering(), oofem::VTKXMLPeriodicExportModule::initRegionNodeNumbering(), oofem::EngngModel::outputElements(), oofem::Delamination::propagateFronts(), oofem::PLCZdamageRadius::propagateInterface(), oofem::NodalAveragingRecoveryModel::recoverValues(), oofem::ZZNodalRecoveryModel::recoverValues(), oofem::QuasicontinuumVTKXMLExportModule::setupVTKPiece(), oofem::VTKBaseExportModule::setupVTKPiece(), oofem::VTKXMLLatticeExportModule::setupVTKPiece(), oofem::VTKXMLPeriodicExportModule::setupVTKPiece(), and oofem::VTKXMLLatticeExportModule::setupVTKPieceCross().

◆ giveElementProperties()

std::string oofem::Set::giveElementProperties ( ) const
inline

Definition at line 181 of file set.h.

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

◆ giveInputRecord()

◆ giveInputRecordName()

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

Implements oofem::FEMComponent.

Definition at line 199 of file set.h.

References _IFT_Set_Name.

◆ giveInternalElementDofManagerList()

const IntArray & oofem::Set::giveInternalElementDofManagerList ( )

Returns list of internal element dof managers within set

Returns
List of internal element dofManagers.

Definition at line 166 of file set.C.

References elementInternalNodes.

Referenced by oofem::Domain::createDofs(), and giveInputRecord().

◆ giveNodeList()

◆ giveSpecifiedNodeList()

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.

Note
This is useful in for example, remeshing code, and should rarely be used elsewhere.
Returns
List of node numbers.

Definition at line 229 of file set.C.

References nodes.

Referenced by oofem::VTKBaseExportModule::exportSetMembership().

◆ giveSurfaceList()

const IntArray & oofem::Set::giveSurfaceList ( )

Returns list of element surfaces within set

Returns
List of element surfaces.

Definition at line 164 of file set.C.

References elementSurfaces.

Referenced by giveInputRecord().

◆ hasElement()

◆ initializeFrom()

void oofem::Set::initializeFrom ( InputRecord & ir)
overridevirtual

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::FEMComponent.

Definition at line 58 of file set.C.

References _IFT_Set_allElements, _IFT_Set_allNodes, _IFT_Set_dofmanprops, _IFT_Set_elementBoundaries, _IFT_Set_elementEdges, _IFT_Set_elementprops, _IFT_Set_elementRanges, _IFT_Set_elements, _IFT_Set_elementSurfaces, _IFT_Set_internalElementNodes, _IFT_Set_nodeRanges, _IFT_Set_nodes, oofem::InputRecord::clone(), computeIntArray(), dofmanprops, elementBoundaries, elementEdges, elementInternalNodes, elementprops, elements, elementSurfaces, oofem::FEMComponent::giveDomain(), oofem::InputRecord::hasField(), IR_GIVE_OPTIONAL_FIELD, mElementListIsSorted, and nodes.

◆ restoreContext()

void oofem::Set::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.

Reimplemented from oofem::FEMComponent.

Definition at line 364 of file set.C.

References oofem::CIO_OK, CM_Definition, elementBoundaries, elementEdges, elementInternalNodes, elements, nodes, THROW_CIOERR, and totalNodes.

◆ saveContext()

void oofem::Set::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::FEMComponent.

Definition at line 340 of file set.C.

References oofem::CIO_OK, CM_Definition, elementBoundaries, elementEdges, elementInternalNodes, elements, nodes, and THROW_CIOERR.

◆ setBoundaryList()

void oofem::Set::setBoundaryList ( IntArray newBoundaries)

Sets list of element boundaries within set.

Definition at line 233 of file set.C.

References elementBoundaries.

◆ setEdgeList()

void oofem::Set::setEdgeList ( IntArray newEdges)

Sets list of element edges within set (must be edges of 3D elements).

Definition at line 235 of file set.C.

References elementEdges.

Referenced by oofem::TransportGradientDirichlet::computeXi().

◆ setElementList()

void oofem::Set::setElementList ( IntArray newElements)

Sets list of elements within set.

Definition at line 231 of file set.C.

References elements, and mElementListIsSorted.

Referenced by oofem::DGProblem::constructBoundaryEntities(), and oofem::Element::mapStateVariables().

◆ setNodeList()

void oofem::Set::setNodeList ( IntArray newNodes)

Sets list of nodes within set.

Definition at line 237 of file set.C.

References nodes.

Referenced by oofem::DGProblem::constructBoundaryEntities().

◆ updateLocalElementNumbering()

void oofem::Set::updateLocalElementNumbering ( EntityRenumberingFunctor & f)

Renumbering of nodes (could change due to load balancing).

Todo
Check order of element number and boundary number (same for edges)

Definition at line 290 of file set.C.

References elementBoundaries, elementEdges, elementInternalNodes, elements, oofem::ERS_Element, oofem::IntArray::followedBy(), mElementListIsSorted, OOFEM_WARNING, and oofem::IntArray::resize().

Referenced by updateLocalNumbering().

◆ updateLocalNodeNumbering()

void oofem::Set::updateLocalNodeNumbering ( EntityRenumberingFunctor & f)

Renumbering of nodes (could change due to load balancing).

Definition at line 271 of file set.C.

References oofem::ERS_DofManager, oofem::IntArray::followedBy(), nodes, and OOFEM_WARNING.

Referenced by updateLocalNumbering().

◆ updateLocalNumbering()

void oofem::Set::updateLocalNumbering ( EntityRenumberingFunctor & f)
overridevirtual

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 265 of file set.C.

References updateLocalElementNumbering(), and updateLocalNodeNumbering().

Member Data Documentation

◆ dofmanprops

std::string oofem::Set::dofmanprops
protected

Dof manager properties.

Definition at line 94 of file set.h.

Referenced by initializeFrom().

◆ elementBoundaries

IntArray oofem::Set::elementBoundaries
protected

◆ elementEdges

IntArray oofem::Set::elementEdges
protected

Element numbers + boundary numbers (interleaved).

Definition at line 88 of file set.h.

Referenced by clear(), giveEdgeList(), giveInputRecord(), giveNodeList(), initializeFrom(), restoreContext(), saveContext(), setEdgeList(), and updateLocalElementNumbering().

◆ elementInternalNodes

IntArray oofem::Set::elementInternalNodes
protected

Element numbers + surface numbers (interleaved).

Definition at line 90 of file set.h.

Referenced by clear(), giveInputRecord(), giveInternalElementDofManagerList(), initializeFrom(), restoreContext(), saveContext(), and updateLocalElementNumbering().

◆ elementprops

std::string oofem::Set::elementprops
protected

Element properties.

Definition at line 93 of file set.h.

Referenced by giveInputRecord(), initializeFrom(), and Set().

◆ elements

◆ elementSurfaces

IntArray oofem::Set::elementSurfaces
protected

Element numbers + edge numbers (interleaved).

Definition at line 89 of file set.h.

Referenced by giveInputRecord(), giveNodeList(), giveSurfaceList(), and initializeFrom().

◆ mElementListIsSorted

bool oofem::Set::mElementListIsSorted
mutableprotected

◆ mElementsSorted

IntArray oofem::Set::mElementsSorted
mutableprotected

Definition at line 86 of file set.h.

Referenced by hasElement().

◆ nodalListInitialized

bool oofem::Set::nodalListInitialized = false
protected

Definition at line 99 of file set.h.

Referenced by giveNodeList().

◆ nodes

IntArray oofem::Set::nodes
protected

Element numbers + internal dof manager numbers (interleaved).

Node numbers.

Definition at line 91 of file set.h.

Referenced by clear(), giveInputRecord(), giveNodeList(), giveSpecifiedNodeList(), initializeFrom(), restoreContext(), saveContext(), setNodeList(), and updateLocalNodeNumbering().

◆ totalNodes

IntArray oofem::Set::totalNodes
protected

Unique set of nodes (computed).

Definition at line 92 of file set.h.

Referenced by clear(), giveNodeList(), and restoreContext().


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