ParallelDomainScal.cc 1.33 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "ParallelDomainScal.h"
#include "ProblemScal.h"
#include "ProblemInstat.h"

namespace AMDiS {

  ParallelDomainScal::ParallelDomainScal(const std::string& name,
					 ProblemScal *problem,
					 ProblemInstatScal *problemInstat)
    : ParallelDomainBase(name, 
			 problem, 
			 problemInstat, 
			 problem->getFESpace(),
			 problem->getRefinementManager()),
      probScal(problem)
  {
    info = problem->getInfo();
  }

  void ParallelDomainScal::initParallelization(AdaptInfo *adaptInfo)
  {
    FUNCNAME("ParallelDomainScal::initParallelization()");

    ParallelDomainBase::initParallelization(adaptInfo);

    DOFMatrix* m = probScal->getSystemMatrix();

    TEST_EXIT(m)("No DOF Matrix!\n");

30
    m->setRankDofs(isRankDof);
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
  }

  void ParallelDomainScal::solve()
  {
    FUNCNAME("ParallelDomainScal::solve()");

#ifdef _OPENMP
    double wtime = omp_get_wtime();
#endif
    clock_t first = clock();

    fillPetscMatrix(probScal->getSystemMatrix(), probScal->getRHS());      
    solvePetscMatrix(probScal->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
  }

}