aboutsummaryrefslogtreecommitdiff
path: root/CarpetDev/CarpetJacobi
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@aei.mpg.de>2005-05-01 20:50:00 +0000
committerErik Schnetter <schnetter@aei.mpg.de>2005-05-01 20:50:00 +0000
commit11ac382474368f028c892b391975f53a8ac57759 (patch)
tree55827438fa69d0ce9ef5defae73eeecdc545335a /CarpetDev/CarpetJacobi
parent0fbb3fc20f36bce10eb1f92921a3f947abef3c99 (diff)
global: Add varying refinement factors
Add support for varying refinement factors. The spatial refinement factors can be different in different directions, can be different from the time refinement factor, and can be different on each level. (However, the underlying spatial transport operators do currently not handle any factors except two.) darcs-hash:20050501205010-891bb-8d3a74abaad55ee6c77ef18d51fca2a2b69740de.gz
Diffstat (limited to 'CarpetDev/CarpetJacobi')
-rw-r--r--CarpetDev/CarpetJacobi/src/Jacobi.cc21
1 files changed, 13 insertions, 8 deletions
diff --git a/CarpetDev/CarpetJacobi/src/Jacobi.cc b/CarpetDev/CarpetJacobi/src/Jacobi.cc
index 99e0ceb6a..cf5407c3f 100644
--- a/CarpetDev/CarpetJacobi/src/Jacobi.cc
+++ b/CarpetDev/CarpetJacobi/src/Jacobi.cc
@@ -194,7 +194,8 @@ namespace CarpetJacobi {
for (int m=0; m<maps; ++m) {
vtt[m]->set_time (reflevel, mglevel, 0);
vtt[m]->set_delta
- (reflevel, mglevel, 1.0 / ipow(reflevelfact, reflevelpower));
+ (reflevel, mglevel, 1.0 / ipow (maxval (spacereflevelfact),
+ reflevelpower));
}
} END_REFLEVEL_LOOP;
@@ -217,14 +218,16 @@ namespace CarpetJacobi {
}
const int icoarsestep
- = ipow (mglevelfact * maxreflevelfact, reflevelpower);
+ = ipow (mglevelfact * maxval (maxspacereflevelfact), reflevelpower);
const int istep
- = ipow (mglevelfact * maxreflevelfact / ipow(reffact, solve_level),
+ = ipow (mglevelfact * maxval (maxspacereflevelfact
+ / spacereffacts.at(solve_level)),
reflevelpower);
int iter = istep;
for (;; iter+=istep) {
- global_time = 1.0 * iter / ipow(maxreflevelfact, reflevelpower);
+ global_time = 1.0 * iter / ipow (maxval (maxspacereflevelfact),
+ reflevelpower);
* const_cast<CCTK_REAL *> (& cctkGH->cctk_time) = global_time;
// cout << "CJ global iter " << iter << " time " << global_time << flush << endl;
@@ -232,7 +235,8 @@ namespace CarpetJacobi {
ierr = 0;
BEGIN_REFLEVEL_LOOP(cctkGH) {
const int do_every
- = ipow (mglevelfact * (maxreflevelfact/reflevelfact),
+ = ipow (mglevelfact * maxval (maxspacereflevelfact
+ / spacereflevelfact),
reflevelpower);
if (reflevel <= solve_level && (iter-istep) % do_every == 0) {
@@ -242,7 +246,7 @@ namespace CarpetJacobi {
}
* const_cast<CCTK_REAL *> (& cctkGH->cctk_time)
= (1.0 * (iter - istep + do_every)
- / ipow(maxreflevelfact, reflevelpower));
+ / ipow (maxval (maxspacereflevelfact), reflevelpower));
CycleTimeLevels (cctkGH);
// cout << "CJ residual iter " << iter << " reflevel " << reflevel << " time " << cctkGH->cctk_time << flush << endl;
@@ -326,7 +330,8 @@ namespace CarpetJacobi {
ierr = 0;
BEGIN_REVERSE_REFLEVEL_LOOP(cctkGH) {
const int do_every
- = ipow (mglevelfact * (maxreflevelfact/reflevelfact),
+ = ipow (mglevelfact * maxval (maxspacereflevelfact
+ / spacereflevelfact),
reflevelpower);
if (reflevel <= solve_level && iter % do_every == 0) {
@@ -533,7 +538,7 @@ namespace CarpetJacobi {
* const_cast<CCTK_REAL *> (& cctkGH->cctk_time) = global_time;
for (int m=0; m<maps; ++m) {
vtt[m]->set_time (reflevel, mglevel, 0);
- vtt[m]->set_delta (reflevel, mglevel, 1.0 / reflevelfact);
+ vtt[m]->set_delta (reflevel, mglevel, 1.0 / timereflevelfact);
}
} END_REFLEVEL_LOOP;