#include "ParallelDomainVec.h" #include "ProblemVec.h" #include "ProblemInstat.h" #include "SystemVector.h" namespace AMDiS { ParallelDomainVec::ParallelDomainVec(std::string name, ProblemVec *problem, ProblemInstatVec *problemInstat) : ParallelDomainBase(name, problem, problemInstat, problem->getFESpace(0), problem->getRefinementManager(0)), probVec(problem) { FUNCNAME("ParallelDomainVec::ParallelDomainVec()"); info = probVec->getInfo(); nComponents = probVec->getNumComponents(); const FiniteElemSpace *fe = probVec->getFESpace(0); for (int i = 0; i < nComponents; i++) TEST_EXIT(fe == probVec->getFESpace(i)) ("Parallelization does not supported different FE spaces!\n"); } void ParallelDomainVec::initParallelization(AdaptInfo *adaptInfo) { FUNCNAME("ParallelDomainVec::initParallelization()"); ParallelDomainBase::initParallelization(adaptInfo); for (int i = 0; i < nComponents; i++) { for (int j = 0; j < nComponents; j++) if (probVec->getSystemMatrix(i, j)) probVec->getSystemMatrix(i, j)->setRankDofs(isRankDof); TEST_EXIT_DBG(probVec->getRHS()->getDOFVector(i))("No rhs vector!\n"); TEST_EXIT_DBG(probVec->getSolution()->getDOFVector(i))("No solution vector!\n"); probVec->getRHS()->getDOFVector(i)->setRankDofs(isRankDof); probVec->getSolution()->getDOFVector(i)->setRankDofs(isRankDof); } } void ParallelDomainVec::solve() { FUNCNAME("ParallelDomainVec::solve()"); #ifdef _OPENMP double wtime = omp_get_wtime(); #endif clock_t first = clock(); fillPetscMatrix(probVec->getSystemMatrix(), probVec->getRHS()); solvePetscMatrix(probVec->getSolution()); #ifdef _OPENMP INFO(info, 8)("solution of discrete system needed %.5f seconds system time / %.5f seconds wallclock time\n", TIME_USED(first, clock()), omp_get_wtime() - wtime); #else INFO(info, 8)("solution of discrete system needed %.5f seconds\n", TIME_USED(first, clock())); #endif } }