42 #ifdef __PARALLEL_MODE 70 #ifdef __PARALLEL_MODE 80 int regionValSize = 0;
88 regionDofMansConnectivity.
resize(regionDofMans);
89 regionDofMansConnectivity.
zero();
93 for (
int i = 1; i <= elements.
giveSize(); i++ ) {
94 int ielem = elements.
at(i);
103 if ( ( interface = static_cast< NodalAveragingRecoveryModelInterface * >
111 for (
int elementNode = 1; elementNode <= elemNodes; elementNode++ ) {
117 }
else if ( regionValSize == 0 ) {
119 lhs.
resize(regionDofMans * regionValSize);
121 }
else if ( val.
giveSize() != regionValSize ) {
125 int eq = ( regionNodalNumbers.
at(node) - 1 ) * regionValSize;
126 for (
int j = 1; j <= regionValSize; j++ ) {
127 lhs.
at(eq + j) += val.
at(j);
130 regionDofMansConnectivity.
at( regionNodalNumbers.
at(node) )++;
134 #ifdef __PARALLEL_MODE 141 for (
int inode = 1; inode <= nnodes; inode++ ) {
142 if ( regionNodalNumbers.
at(inode) ) {
143 int eq = ( regionNodalNumbers.
at(inode) - 1 ) * regionValSize;
144 for (
int i = 1; i <= regionValSize; i++ ) {
145 if ( regionDofMansConnectivity.
at( regionNodalNumbers.
at(inode) ) > 0 ) {
146 lhs.
at(eq + i) /= regionDofMansConnectivity.
at( regionNodalNumbers.
at(inode) );
148 OOFEM_WARNING(
"values of dofmanager %d undetermined", inode);
149 lhs.
at(eq + i) = 0.0;
163 #ifdef __PARALLEL_MODE 174 OOFEM_LOG_INFO(
"NodalAveragingRecoveryModel :: initCommMaps: initialized comm maps\n");
181 IntArray ®ionNodalNumbers,
int regionValSize)
183 parallelStruct ls( &lhs, ®ionDofMansConnectivity, ®ionNodalNumbers, regionValSize);
195 int result = 1, size;
200 for (
int i = 1; i <= size; i++ ) {
206 result &= pcbuff->
write(1);
210 result &= pcbuff->
write( s->
lhs->
at(eq + j) );
214 result &= pcbuff->
write(0);
225 int size, flag, intValue;
231 for (
int i = 1; i <= size; i++ ) {
235 result &= pcbuff->
read(flag);
238 result &= pcbuff->
read(intValue);
246 result &= pcbuff->
read(value);
248 s->
lhs->
at(eq + j) += value;
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
The element interface required by NodalAvergagingRecoveryModel.
~NodalAveragingRecoveryModel()
Destructor.
int initExchange(int tag)
Initializes data exchange with all problems.
int initRegionNodeNumbering(IntArray ®ionNodalNumbers, int ®ionDofMans, Set ®ion)
Determine local region node numbering and determine and check nodal values size.
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
NodalAveragingRecoveryModel(Domain *d)
Constructor.
int packAllData(T *ptr, int(T::*packFunc)(ProcessCommunicator &))
Pack all problemCommunicators data to their send buffers.
void zero()
Sets all component to zero.
double & at(int i)
Coefficient access function.
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
bool isParallel() const
Returns true if receiver in parallel mode.
Abstract base class for all finite elements.
int giveNumberOfProcesses() const
Returns the number of collaborating processes.
int updateRegionRecoveredValues(const IntArray ®ionNodalNumbers, int regionValSize, const FloatArray &rhs)
Update the nodal table according to recovered solution for given region.
The ProcessCommunicator and corresponding buffers (represented by this class) are separated in order ...
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual int giveNumberOfDofManagers() const
int finishExchange()
Finishes the exchange.
#define OOFEM_LOG_RELEVANT(...)
REGISTER_NodalRecoveryModel(NodalAveragingRecoveryModel, NodalRecoveryModel::NRM_NodalAveraging)
const IntArray * giveToSendMap()
Returns receiver to send map.
int recoverValues(Set elementSet, InternalStateType type, TimeStep *tStep)
Recovers the nodal values for all regions.
#define OOFEM_LOG_INFO(...)
Element * giveElement(int n)
Service for accessing particular domain fe element.
virtual int write(const int *data, int count)
Writes count integer values from array pointed by data.
IntArray * regionNodalNumbers
StateCounterType giveSolutionStateCounter()
Returns current solution state counter.
virtual void NodalAveragingRecoveryMI_computeNodalValue(FloatArray &answer, int node, InternalStateType type, TimeStep *tStep)=0
Computes the element value in given node.
ProcessCommunicatorBuff * giveProcessCommunicatorBuff()
Returns communication buffer.
const IntArray * giveToRecvMap()
Returns receiver to receive map.
Set of elements, boundaries, edges and/or nodes.
Class representing process communicator for engineering model.
CommunicatorBuff * commBuff
Common Communicator buffer.
void resize(int n)
Checks size of receiver towards requested bounds.
int unpackSharedDofManData(parallelStruct *s, ProcessCommunicator &processComm)
ProblemCommunicator * communicator
Communicator.
StateCounterType stateCounter
Time stamp of recovered values.
virtual int clear()
Clears the receiver's nodal table.
void exchangeDofManValues(FloatArray &lhs, IntArray &, IntArray &, int)
Class representing vector of real numbers.
int unpackAllData(T *ptr, int(T::*unpackFunc)(ProcessCommunicator &))
Unpack all problemCommuncators data from recv buffers.
elementParallelMode giveParallelMode() const
Return elementParallelMode of receiver.
Element is local, there are no contributions from other domains to this element.
int packSharedDofManData(parallelStruct *s, ProcessCommunicator &processComm)
void zero()
Zeroes all coefficients of receiver.
int giveRank() const
Returns domain rank in a group of collaborating processes (0..groupSize-1)
virtual Interface * giveInterface(InterfaceType t)
Interface requesting service.
virtual int read(int *data, int count)
Reads count integer values into array pointed by data.
The Communicator and corresponding buffers (represented by this class) are separated in order to allo...
const char * __InternalStateTypeToString(InternalStateType _value)
Abstract base class representing the "problem" under consideration.
int giveSize() const
Returns the size of receiver.
the oofem namespace is to define a context or scope in which all oofem names are defined.
DofManager * giveDofManager(int i) const
bool initCommMap
Communication init flag.
The base class for all recovery models, which perform nodal averaging or projection processes for int...
IntArray * regionDofMansConnectivity
Helper structure to pass required arguments to packing/unpacking functions needed in parallel mode...
#define OOFEM_WARNING(...)
InternalStateType valType
Determines the type of recovered values.
Class representing solution step.
const IntArray & giveElementList()
Returns list of elements within set.
void resize(int s)
Resizes receiver towards requested size.