45#ifdef __MPI_PARALLEL_MODE
53#ifdef __MPI_PARALLEL_MODE
58DirectErrorIndicatorRC :: ~DirectErrorIndicatorRC()
63DirectErrorIndicatorRC :: giveNodeChar(
int inode,
TimeStep *tStep,
double &indicatorVal,
double &currDensity)
71DirectErrorIndicatorRC :: giveDofManDensity(
int num)
73#ifdef __MPI_PARALLEL_MODE
88DirectErrorIndicatorRC :: giveLocalDofManDensity(
int num)
91 double currDensity = 0.0;
99 for (
int i = 1; i <= isize; i++ ) {
115DirectErrorIndicatorRC :: giveDofManIndicator(
int num,
TimeStep *tStep)
117#ifdef __MPI_PARALLEL_MODE
132DirectErrorIndicatorRC :: giveLocalDofManIndicator(
int inode,
TimeStep *tStep)
138 double indicatorVal = 0.0;
143 for (
int i = 1; i <= isize; i++ ) {
148 indicatorVal =
ee->giveElementError(
indicatorET, element, tStep);
150 indicatorVal =
max( indicatorVal,
ee->giveElementError(
indicatorET, element, tStep) );
160DirectErrorIndicatorRC :: estimateMeshDensities(
TimeStep *tStep)
164 double indicatorVal, currDensity, proposedDensity;
170#ifdef __MPI_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 __MPI_PARALLEL_MODE
214 MPI_Allreduce(& myStrategy, & globalStrategy, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD);
225DirectErrorIndicatorRC :: giveRequiredDofManDensity(
int num,
TimeStep *tStep,
int relative)
250#ifdef __MPI_PARALLEL_MODE
259DirectErrorIndicatorRC :: giveRemeshingStrategy(
TimeStep *tStep)
266DirectErrorIndicatorRC :: reinitialize()
269#ifdef __MPI_PARALLEL_MODE
277DirectErrorIndicatorRC :: setDomain(
Domain *d)
279 RemeshingCriteria :: setDomain(d);
280#ifdef __MPI_PARALLEL_MODE
287#ifdef __MPI_PARALLEL_MODE
289DirectErrorIndicatorRC :: exchangeDofManDensities()
296 int size =
domain->giveNumberOfDofManagers();
297 for (
int i = 1; i <= size; i++ ) {
304 communicator->packAllData(
this, & DirectErrorIndicatorRC :: packSharedDofManLocalDensities);
306 communicator->unpackAllData(
this, & DirectErrorIndicatorRC :: unpackSharedDofManLocalDensities);
320 for (
int inode : toSendMap ) {
335 for (
int inode : toRecvMap ) {
336 result &= pcbuff->
read(value);
338 #ifdef __VERBOSE_PARALLEL
339 OOFEM_LOG_INFO(
"unpackSharedDofManLocalDensities: node %d[%d], value %f\n", inode,
domain->giveDofManager( inode )->giveGlobalNumber(), this->sharedDofManDensities [ inode ]);
350DirectErrorIndicatorRC :: exchangeDofManIndicatorVals(
TimeStep *tStep)
356 int size =
domain->giveNumberOfDofManagers();
357 for (
int i = 1; i <= size; i++ ) {
364 communicator->packAllData(
this, & DirectErrorIndicatorRC :: packSharedDofManLocalIndicatorVals);
366 communicator->unpackAllData(
this, & DirectErrorIndicatorRC :: unpackSharedDofManLocalIndicatorVals);
377 for (
int inode : toSendMap ) {
391 for (
int inode : toRecvMap ) {
393 result &= pcbuff->
read(value);
395 #ifdef __VERBOSE_PARALLEL
396 OOFEM_LOG_INFO(
"unpackSharedDofManLocalIndicatorVals: node %d[%d], value %f\n", inode,
domain->giveDofManager( inode )->giveGlobalNumber(), this->sharedDofManIndicatorVals [ inode ]);
const IntArray * giveDofManConnectivityArray(int dofman)
double remeshingDensityRatioToggle
bool dofManDensityExchangeFlag
void exchangeDofManDensities()
double giveLocalDofManIndicator(int num, TimeStep *tStep)
double maxIndicatorDensity
FloatArray nodalDensities
double giveLocalDofManDensity(int num)
StateCounterType stateCounter
Actual values (densities) state counter.
double zeroIndicatorDensity
Default mesh density for Indicator value < minIndicatorLimit.
void exchangeDofManIndicatorVals(TimeStep *tStep)
double minIndicatorDensity
std ::map< int, double > sharedDofManDensities
RemeshingStrategy currStrategy
double giveDofManIndicator(int num, TimeStep *tStep)
double giveDofManDensity(int num) override
std ::map< int, double > sharedDofManIndicatorVals
void giveNodeChar(int inode, TimeStep *tStep, double &indicatorVal, double &currDensity)
int estimateMeshDensities(TimeStep *tStep) override
bool isShared()
Returns true if receiver is shared.
ConnectivityTable * giveConnectivityTable()
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
DofManager * giveDofManager(int n)
Element * giveElement(int n)
EngngModel * giveEngngModel()
int giveNumberOfProcesses() const
Returns the number of collaborating processes.
int giveRank() const
Returns domain rank in a group of collaborating processes (0..groupSize-1).
Domain * giveDomain() const
Domain * domain
Link to domain object, useful for communicating with other FEM components.
int read(int *data, std::size_t count) override
Reads count integer values into array pointed by data.
int write(const int *data, std::size_t count) override
Writes count integer values from array pointed by data.
const IntArray & giveToRecvMap()
ProcessCommunicatorBuff * giveProcessCommunicatorBuff()
Returns communication buffer.
const IntArray & giveToSendMap()
bool initCommMap
Communication init flag.
RemeshingCriteria(int n, ErrorEstimator *e)
Constructor.
ProblemCommunicator * communicator
Communicator.
CommunicatorBuff * commBuff
Common Communicator buffer.
StateCounterType giveSolutionStateCounter()
#define _IFT_DirectErrorIndicatorRC_mindens
#define _IFT_DirectErrorIndicatorRC_remeshingdensityratio
#define _IFT_DirectErrorIndicatorRC_maxdens
#define _IFT_DirectErrorIndicatorRC_maxlim
#define _IFT_DirectErrorIndicatorRC_minlim
#define _IFT_DirectErrorIndicatorRC_defdens
#define OOFEM_LOG_INFO(...)
#define OOFEM_LOG_DEBUG(...)
FloatArrayF< N > max(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
RemeshingStrategy
Type representing the remeshing strategy.
@ RemeshingFromCurrentState_RS