OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::Set Class Reference

Set of elements, boundaries, edges and/or nodes. More...

#include <set.h>

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

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 IntArraygiveElementList ()
 Returns list of elements within set. More...
 
const IntArraygiveBoundaryList ()
 Returns list of element boundaries within set. More...
 
const IntArraygiveEdgeList ()
 Returns list of element edges within set (must be edges of 3D elements). More...
 
const IntArraygiveSurfaceList ()
 Returns list of element surfaces within set. More...
 
const IntArraygiveNodeList ()
 Returns list of all nodes within set. More...
 
const IntArraygiveSpecifiedNodeList ()
 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...
 
DomaingiveDomain () 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 InterfacegiveInterface (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...
 
Domaindomain
 Link to domain object, useful for communicating with other FEM components. More...
 

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.

Author
Mikael Öhman

Definition at line 66 of file set.h.

Constructor & Destructor Documentation

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

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

Parameters
nSet number.
dDomain to which component belongs to.

Definition at line 84 of file set.h.

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

Definition at line 85 of file set.h.

Member Function Documentation

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().

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 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().

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

Implements oofem::FEMComponent.

Definition at line 164 of file set.h.

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

References elementEdges.

Referenced by giveInputRecord().

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

Implements oofem::FEMComponent.

Definition at line 165 of file set.h.

References _IFT_Set_Name.

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

References nodes.

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

Returns list of element surfaces within set.

Returns
List of element surfaces.

Definition at line 144 of file set.C.

References elementSurfaces.

Referenced by giveInputRecord().

IRResultType oofem::Set::initializeFrom ( InputRecord ir)
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.

See also
IR_GIVE_FIELD
IR_GIVE_OPTIONAL_FIELD
Parameters
irInput record to initialize from.
Returns
IRResultType

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.

contextIOResultType oofem::Set::restoreContext ( DataStream stream,
ContextMode  mode,
void *  obj = NULL 
)
virtual

Restores the receiver state previously written in stream.

See also
saveContext
Parameters
streamInput stream.
modeDetermines amount of info available in stream (state, definition, ...).
objSpecial parameter for sending extra information.
Returns
contextIOResultType.
Exceptions
throwsan 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.

contextIOResultType oofem::Set::saveContext ( DataStream stream,
ContextMode  mode,
void *  obj = NULL 
)
virtual

Stores receiver state to output stream.

Parameters
streamOutput stream.
modeDetermines amount of info required in stream (state, definition, ...).
objSpecial parameter, used only to send particular integration point to material class version of this method.
Returns
contextIOResultType.
Exceptions
throwsan 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)

Sets list of nodes within set.

Definition at line 210 of file set.C.

References nodes.

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 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().

void oofem::Set::updateLocalNumbering ( EntityRenumberingFunctor f)
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().

Member Data Documentation

IntArray oofem::Set::elementBoundaries
protected
IntArray oofem::Set::elementEdges
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().

IntArray oofem::Set::elementSurfaces
protected

Element numbers + edge numbers (interleaved).

Definition at line 74 of file set.h.

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

bool oofem::Set::mElementListIsSorted
mutableprotected
IntArray oofem::Set::mElementsSorted
mutableprotected

Definition at line 71 of file set.h.

Referenced by hasElement().

IntArray oofem::Set::nodes
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().

IntArray oofem::Set::totalNodes
protected

Unique set of nodes (computed).

Definition at line 76 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 documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:41 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011