51 #ifdef __PARALLEL_MODE 56 #define ZZNRM_ZERO_VALUE 1.e-12 73 std :: set< int >unresolvedDofMans;
83 #ifdef __PARALLEL_MODE 102 lhs.
resize(regionDofMans);
106 for (
int i = 1; i <= elements.
giveSize(); i++ ) {
107 int ielem = elements.
at(i);
132 if ( regionValSize == 0 ) {
134 rhs.
resize(regionDofMans, regionValSize);
136 if ( regionValSize == 0 ) {
140 nsig.
resize(regionDofMans, regionValSize);
147 for (
int elementNode = 1; elementNode <= elemNodes; elementNode++ ) {
149 lhs.
at( regionNodalNumbers.
at(node) ) += nn.
at(eq);
150 for (
int j = 1; j <= regionValSize; j++ ) {
151 rhs.
at(regionNodalNumbers.
at(node), j) += nsig.
at(eq, j);
158 #ifdef __PARALLEL_MODE 164 sol.
resize(regionDofMans * regionValSize);
167 bool missingDofManContribution =
false;
168 unresolvedDofMans.clear();
170 for (
int i = 1; i <= regionDofMans; i++ ) {
171 int eq = ( i - 1 ) * regionValSize;
172 for (
int j = 1; j <= regionValSize; j++ ) {
175 sol.
at(eq + j) = rhs.
at(i, j) / lhs.
at(i);
177 missingDofManContribution =
true;
178 unresolvedDofMans.insert( regionNodalNumbers.
at(i) );
179 sol.
at(eq + j) = 0.0;
187 if ( missingDofManContribution ) {
188 std :: ostringstream msg;
190 for (
int dman: unresolvedDofMans ) {
199 OOFEM_WARNING(
"some values of some dofmanagers undetermined (in global numbers) \n[%s]", msg.str().c_str() );
222 double dV = element->computeVolumeAround(gp);
224 if ( !element->giveIPValue(stressVector, gp, type, tStep) ) {
253 OOFEM_ERROR(
"Element %d not providing interpolation", element->giveNumber() );
256 int size = element->giveNumberOfDofManagers();
257 fullAnswer.
resize(size, size);
262 double dV = element->computeVolumeAround(gp);
265 pok += ( n.
at(1) * dV );
272 for (
int i = 1; i <= size; i++ ) {
274 for (
int j = 1; j <= size; j++ ) {
275 sum += fullAnswer.
at(i, j);
283 #ifdef __PARALLEL_MODE 288 #ifdef __PARALLEL_MODE 295 OOFEM_LOG_INFO(
"ZZNodalRecoveryModel :: initCommMaps: initialized comm maps");
317 int result = 1, indx, nc, size;
323 for (
int i = 1; i <= size; i++ ) {
329 result &= pcbuff->
write(1);
331 for (
int j = 1; j <= nc; j++ ) {
332 result &= pcbuff->
write( s->
rhs->
at(indx, j) );
339 result &= pcbuff->
write(0);
350 int nc, indx, size, flag;
357 for (
int i = 1; i <= size; i++ ) {
361 result &= pcbuff->
read(flag);
364 result &= pcbuff->
read(value);
367 s->
lhs->
at(indx) += value;
370 for (
int j = 1; j <= nc; j++ ) {
371 result &= pcbuff->
read(value);
373 s->
rhs->
at(indx, j) += value;
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
int giveNumberOfColumns() const
Returns number of columns of receiver.
int initExchange(int tag)
Initializes data exchange with all problems.
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the array of interpolation functions (shape functions) at given point.
IntArray * regionNodalNumbers
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.
The element interface required by ZZNodalRecoveryModel.
int packAllData(T *ptr, int(T::*packFunc)(ProcessCommunicator &))
Pack all problemCommunicators data to their send buffers.
double & at(int i)
Coefficient access function.
int packSharedDofManData(parallelStruct *s, ProcessCommunicator &processComm)
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.
void plusDyadUnsym(const FloatArray &a, const FloatArray &b, double dV)
Adds to the receiver the product .
The ProcessCommunicator and corresponding buffers (represented by this class) are separated in order ...
Helper structure to pass required arguments to packing/unpacking functions needed in parallel mode...
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual int recoverValues(Set elementSet, InternalStateType type, TimeStep *tStep)
Recovers the nodal values for all regions.
virtual int giveNumberOfDofManagers() const
Abstract base class representing integration rule.
int finishExchange()
Finishes the exchange.
#define OOFEM_LOG_RELEVANT(...)
REGISTER_NodalRecoveryModel(NodalAveragingRecoveryModel, NodalRecoveryModel::NRM_NodalAveraging)
const IntArray * giveToSendMap()
Returns receiver to send map.
int unpackSharedDofManData(parallelStruct *s, ProcessCommunicator &processComm)
Class representing a general abstraction for finite element interpolation class.
#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.
StateCounterType giveSolutionStateCounter()
Returns current solution state counter.
virtual bool ZZNodalRecoveryMI_computeNValProduct(FloatMatrix &answer, InternalStateType type, TimeStep *tStep)
Computes the element contribution to , where is quantity to be recovered (for example stress or stra...
ProcessCommunicatorBuff * giveProcessCommunicatorBuff()
Returns communication buffer.
const IntArray * giveToRecvMap()
Returns receiver to receive map.
Set of elements, boundaries, edges and/or nodes.
Wrapper around element definition to provide FEICellGeometry interface.
Class representing process communicator for engineering model.
CommunicatorBuff * commBuff
Common Communicator buffer.
double at(int i, int j) const
Coefficient access function.
ProblemCommunicator * communicator
Communicator.
StateCounterType stateCounter
Time stamp of recovered values.
virtual int clear()
Clears the receiver's nodal table.
Class representing vector of real numbers.
void plusDyadSymmUpper(const FloatArray &a, double dV)
Adds to the receiver the dyadic product .
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.
Implementation of matrix containing floating point numbers.
void exchangeDofManValues(FloatArray &lhs, FloatMatrix &rhs, IntArray &rn)
virtual void ZZNodalRecoveryMI_computeNNMatrix(FloatArray &answer, InternalStateType type)
Computes the element contribution to term.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
void zero()
Zeroes all coefficients of receiver.
int giveRank() const
Returns domain rank in a group of collaborating processes (0..groupSize-1)
virtual ~ZZNodalRecoveryModel()
Destructor.
virtual Interface * giveInterface(InterfaceType t)
Interface requesting service.
void zero()
Zeroes all coefficient of receiver.
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.
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.
void clear()
Sets size of receiver to be an empty matrix. It will have zero rows and zero columns size...
ZZNodalRecoveryModel(Domain *d)
Constructor.
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
The base class for all recovery models, which perform nodal averaging or projection processes for int...
void symmetrized()
Initializes the lower half of the receiver according to the upper half.
Class representing integration point in finite element program.
#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.