35 #include "../sm/ErrorEstimators/directerrorindicatorrc.h" 45 #ifdef __PARALLEL_MODE 53 #ifdef __PARALLEL_MODE 73 #ifdef __PARALLEL_MODE 91 double currDensity = 0.0;
99 for (
int i = 1; i <= isize; i++ ) {
117 #ifdef __PARALLEL_MODE 138 double indicatorVal = 0.0;
143 for (
int i = 1; i <= isize; i++ ) {
164 double indicatorVal, currDensity, proposedDensity;
170 #ifdef __PARALLEL_MODE 173 OOFEM_LOG_INFO(
"DirectErrorIndicatorRC :: estimateMeshDensities: initialized comm maps\n");
185 for ( inode = 1; inode <= nnodes; inode++ ) {
186 this->
giveNodeChar(inode, tStep, indicatorVal, currDensity);
195 OOFEM_LOG_DEBUG(
"DirectEI: remeshing required for node %d, den %e, required_dens %e\n", inode, currDensity, proposedDensity);
205 OOFEM_LOG_DEBUG(
"DirectEI: remeshing required for node %d, den %e, required_dens %e\n", inode, currDensity, proposedDensity);
211 #ifdef __PARALLEL_MODE 214 MPI_Allreduce(& myStrategy, & globalStrategy, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD);
252 #ifdef __PARALLEL_MODE 272 #ifdef __PARALLEL_MODE 283 #ifdef __PARALLEL_MODE 290 #ifdef __PARALLEL_MODE 300 for (
int i = 1; i <= size; i++ ) {
319 int result = 1, i, size;
324 for ( i = 1; i <= size; i++ ) {
341 for ( i = 1; i <= size; i++ ) {
342 result &= pcbuff->
read(value);
344 #ifdef __VERBOSE_PARALLEL 363 for (
int i = 1; i <= size; i++ ) {
379 int result = 1, i, size;
385 for ( i = 1; i <= size; i++ ) {
402 for ( i = 1; i <= size; i++ ) {
403 result &= pcbuff->
read(value);
405 #ifdef __VERBOSE_PARALLEL
double giveDofManIndicator(int num, TimeStep *tStep)
Returns dof man indicator values.
double giveLocalDofManIndicator(int num, TimeStep *tStep)
#define _IFT_DirectErrorIndicatorRC_minlim
The base class for all remeshing criteria.
int initExchange(int tag)
Initializes data exchange with all problems.
double remeshingDensityRatioToggle
Ratio between proposedDensity and currDensity.
DirectErrorIndicatorRC(int n, ErrorEstimator *e)
Constructor.
Domain * domain
Link to domain object, useful for communicating with other FEM components.
double computeMeanSize()
Computes the size of the element defined as its length.
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
int packAllData(T *ptr, int(T::*packFunc)(ProcessCommunicator &))
Pack all problemCommunicators data to their send buffers.
double & at(int i)
Coefficient access function.
int max(int i, int j)
Returns bigger value form two given decimals.
int unpackSharedDofManLocalDensities(ProcessCommunicator &processComm)
ProblemCommunicator * communicator
Communicator.
virtual int estimateMeshDensities(TimeStep *tStep)
Estimates the nodal densities.
int unpackSharedDofManLocalIndicatorVals(ProcessCommunicator &processComm)
ConnectivityTable * giveConnectivityTable()
Returns receiver's associated connectivity table.
CommunicatorBuff * commBuff
Common Communicator buffer.
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
Abstract base class for all finite elements.
int giveNumberOfProcesses() const
Returns the number of collaborating processes.
bool dofManDensityExchangeFlag
double giveLocalDofManDensity(int num)
The ProcessCommunicator and corresponding buffers (represented by this class) are separated in order ...
bool initCommMap
Communication init flag.
#define OOFEM_LOG_DEBUG(...)
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
#define _IFT_DirectErrorIndicatorRC_maxlim
virtual void setUpCommunicationMaps(EngngModel *emodel, bool excludeSelfCommFlag, bool forceReinit=false)=0
Service for setting up the communication patterns with other remote process.
double zeroIndicatorDensity
Default mesh density for Indicator value < minIndicatorLimit.
int finishExchange()
Finishes the exchange.
const IntArray * giveToSendMap()
Returns receiver to send map.
virtual RemeshingStrategy giveRemeshingStrategy(TimeStep *tStep)
Determines, if the remeshing is needed, and if needed, the type of strategy used. ...
int packSharedDofManLocalDensities(ProcessCommunicator &processComm)
#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.
std::map< int, double > sharedDofManIndicatorVals
virtual double giveRequiredDofManDensity(int num, TimeStep *tStep, int relative=0)
Returns the required mesh size n given dof manager.
virtual void setDomain(Domain *d)
Sets associated Domain.
ProcessCommunicatorBuff * giveProcessCommunicatorBuff()
Returns communication buffer.
const IntArray * giveToRecvMap()
Returns receiver to receive map.
Class representing connectivity table.
Class representing process communicator for engineering model.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual ~DirectErrorIndicatorRC()
The base class for all error estimation or error indicator algorithms.
#define _IFT_DirectErrorIndicatorRC_defdens
int unpackAllData(T *ptr, int(T::*unpackFunc)(ProcessCommunicator &))
Unpack all problemCommuncators data from recv buffers.
RemeshingStrategy
Type representing the remeshing strategy.
const IntArray * giveDofManConnectivityArray(int dofman)
IRResultType
Type defining the return values of InputRecord reading operations.
#define _IFT_DirectErrorIndicatorRC_remeshingdensityratio
void exchangeDofManDensities()
double maxIndicatorDensity
virtual void reinitialize()
int giveRank() const
Returns domain rank in a group of collaborating processes (0..groupSize-1)
#define _IFT_DirectErrorIndicatorRC_mindens
void giveNodeChar(int inode, TimeStep *tStep, double &indicatorVal, double &currDensity)
#define _IFT_DirectErrorIndicatorRC_maxdens
Domain * giveDomain() const
std::map< int, double > sharedDofManDensities
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...
Abstract base class representing the "problem" under consideration.
RemeshingStrategy currStrategy
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual double giveElementError(EE_ErrorType type, Element *elem, TimeStep *tStep)=0
Returns the element error.
void exchangeDofManIndicatorVals(TimeStep *tStep)
double minIndicatorDensity
FloatArray nodalDensities
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
bool isShared()
Returns true if receiver is shared.
virtual void setDomain(Domain *d)
Sets associated Domain.
int packSharedDofManLocalIndicatorVals(ProcessCommunicator &processComm)
Class representing solution step.
DofManager is shared by neighboring partitions, it is necessary to sum contributions from all contrib...
dofManagerParallelMode giveParallelMode() const
Return dofManagerParallelMode of receiver.
virtual double giveDofManDensity(int num)
Returns existing mesh size for given dof manager.
void resize(int s)
Resizes receiver towards requested size.
StateCounterType stateCounter
Actual values (densities) state counter.