Commit fc5e6ac8 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Adapted ES marker for parallel computations.

parent a2911e8d
#include "Marker.h"
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#include "parallel/MpiHelper.h"
#endif
namespace AMDiS {
Marker *Marker::createMarker(std::string name, int row)
......@@ -113,14 +117,18 @@ namespace AMDiS {
double ESThetaP = pow(ESTheta, p);
double ESThetaCP = pow(ESThetaC, p);
double epsP = pow(adaptInfo->getSpaceTolerance(row == -1 ? 0 : row), p);
int nLeaves = mesh->getNumberOfLeaves();
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
mpi::globalAdd(nLeaves);
#endif
markRLimit = ESThetaP * epsP / mesh->getNumberOfLeaves();
markCLimit = ESThetaCP * epsP / mesh->getNumberOfLeaves();
markRLimit = ESThetaP * epsP / nLeaves;
markCLimit = ESThetaCP * epsP / nLeaves;
INFO(info, 2)("start mark_limits: %.3le %.3le nt=%d\n",
markRLimit, markCLimit, mesh->getNumberOfLeaves());
INFO(info, 2)("start mark_limits: %.3le %.3le nt = %d\n",
markRLimit, markCLimit, nLeaves);
}
......@@ -137,14 +145,12 @@ namespace AMDiS {
GERSSum = 0.0;
double LTheta = pow(1.0 - GERSThetaStar, p);
double improv, redfac, wanted, epsP, GERSGamma;
epsP = pow(adaptInfo->getSpaceTolerance(row == -1 ? 0 : row), p);
double epsP = pow(adaptInfo->getSpaceTolerance(row == -1 ? 0 : row), p);
if (estSum < oldErrSum) {
improv = estSum / oldErrSum;
wanted = 0.8 * epsP / estSum;
redfac = std::min((1.0 - wanted) / (1.0 - improv), 1.0);
double improv = estSum / oldErrSum;
double wanted = 0.8 * epsP / estSum;
double redfac = std::min((1.0 - wanted) / (1.0 - improv), 1.0);
redfac = std::max(redfac, 0.0);
if (redfac < 1.0) {
......@@ -155,7 +161,7 @@ namespace AMDiS {
}
oldErrSum = estSum;
GERSGamma = 1.0;
double GERSGamma = 1.0;
if (adaptInfo->isRefinementAllowed(row == -1 ? 0 : row)) {
if (LTheta > 0) {
......@@ -195,7 +201,7 @@ namespace AMDiS {
elInfo = stack.traverseNext(elInfo);
}
INFO(info, 6)("coarse loop: gamma=%.3e, sum=%.3e, limit=%.3e\n",
INFO(info, 6)("coarse loop: gamma = %.3e, sum = %.3e, limit = %.3e\n",
GERSGamma, GERSSum, LTheta);
} while(GERSSum > LTheta);
......@@ -213,6 +219,7 @@ namespace AMDiS {
return(markFlag);
}
void GERSMarker::markElementForRefinement(AdaptInfo *adaptInfo, ElInfo *elInfo)
{
Element *el = elInfo->getElement();
......@@ -224,6 +231,7 @@ namespace AMDiS {
}
}
void GERSMarker::markElementForCoarsening(AdaptInfo *adaptInfo, ElInfo *elInfo)
{
Element *el = elInfo->getElement();
......
......@@ -385,8 +385,6 @@ namespace AMDiS {
{
FUNCNAME("GlobalMatrixSolver::fillPetscMatrix()");
MSG("START FILL PETSC MATRIX!\n");
clock_t first = clock();
int nRankRows = meshDistributor->getNumberRankDofs() * nComponents;
int nOverallRows = meshDistributor->getNumberOverallDofs() * nComponents;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment