aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2006-06-06 00:40:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2006-06-06 00:40:00 +0000
commit55d164940440e74513d82df6968a7ad00c04b06b (patch)
treeb4801e3f131378036ad8d77b0e977f576b816f27
parent5b7631a4c17911168d60f886ffd651a51368afe7 (diff)
Carpet: Explicitly convert vect<int> to vect<CCTK_REAL>
darcs-hash:20060606004037-dae7b-1d66342c36d3d55bb8491079005fc286bd6da579.gz
-rw-r--r--Carpet/Carpet/src/Recompose.cc17
-rw-r--r--Carpet/Carpet/src/SetupGH.cc8
2 files changed, 14 insertions, 11 deletions
diff --git a/Carpet/Carpet/src/Recompose.cc b/Carpet/Carpet/src/Recompose.cc
index 6d438c1b1..8b027185b 100644
--- a/Carpet/Carpet/src/Recompose.cc
+++ b/Carpet/Carpet/src/Recompose.cc
@@ -265,11 +265,11 @@ namespace Carpet {
const ivect levfact = spacereffacts.at(rl);
cout << " [" << ml << "][" << rl << "][" << m << "][" << c << "]"
<< " exterior: "
- << origin + delta * lower / maxspacereflevelfact
+ << origin + delta * rvect(lower) / rvect(maxspacereflevelfact)
<< " : "
- << origin + delta * upper / maxspacereflevelfact
+ << origin + delta * rvect(upper) / rvect(maxspacereflevelfact)
<< " : "
- << delta * convfact / levfact << endl;
+ << delta * rvect(convfact) / rvect(levfact) << endl;
}
}
}
@@ -282,7 +282,8 @@ namespace Carpet {
for (int rl=0; rl<hh.reflevels(); ++rl) {
const CCTK_REAL basevolume
- = prod (rvect (hh.baseextent.shape()) / hh.baseextent.stride());
+ = prod (rvect (hh.baseextent.shape())
+ / rvect (hh.baseextent.stride()));
CCTK_REAL countvolume = 0;
CCTK_REAL totalvolume = 0;
CCTK_REAL totalvolume2 = 0;
@@ -290,7 +291,7 @@ namespace Carpet {
for (int c=0; c<hh.components(rl); ++c) {
const ivect shape = hh.extents().at(ml).at(rl).at(c).shape();
const ivect stride = hh.extents().at(ml).at(rl).at(c).stride();
- const CCTK_REAL volume = prod (rvect (shape) / stride);
+ const CCTK_REAL volume = prod (rvect (shape) / rvect (stride));
++ countvolume;
totalvolume += volume;
totalvolume2 += ipow(volume, 2);
@@ -304,7 +305,7 @@ namespace Carpet {
for (int c=0; c<hh.components(rl); ++c) {
const ivect shape = hh.extents().at(ml).at(rl).at(c).shape();
const ivect stride = hh.extents().at(ml).at(rl).at(c).stride();
- const CCTK_REAL volume = prod(rvect (shape) / stride);
+ const CCTK_REAL volume = prod(rvect (shape) / rvect (stride));
cout << " [" << ml << "][" << rl << "][" << m << "][" << c << "]"
<< " volume: " << setprecision(0) << volume
<< " of parent: " << setprecision(1) << 100 * volume / totalvolume << "%"
@@ -334,8 +335,8 @@ namespace Carpet {
for (int c=0; c<hh.components(rl); ++c) {
const ivect shape = hh.extents().at(ml).at(rl).at(c).shape();
const ivect stride = hh.extents().at(ml).at(rl).at(c).stride();
- const CCTK_REAL minlength = minval (rvect (shape) / stride);
- const CCTK_REAL maxlength = maxval (rvect (shape) / stride);
+ const CCTK_REAL minlength = minval (rvect (shape) / rvect (stride));
+ const CCTK_REAL maxlength = maxval (rvect (shape) / rvect (stride));
const CCTK_REAL quadrupole = minlength / maxlength;
++ countquadrupole;
minquadrupole = min (minquadrupole, quadrupole);
diff --git a/Carpet/Carpet/src/SetupGH.cc b/Carpet/Carpet/src/SetupGH.cc
index 6c86f4cb1..dfd768086 100644
--- a/Carpet/Carpet/src/SetupGH.cc
+++ b/Carpet/Carpet/src/SetupGH.cc
@@ -816,7 +816,9 @@ namespace Carpet {
exterior_min, exterior_max, spacing);
rvect const real_npoints
- = spacing.ifthen ((exterior_max - exterior_min) / spacing + 1, rvect(1));
+ = either (spacing,
+ (exterior_max - exterior_min) / spacing + rvect(1),
+ rvect(1));
print_map_base_grid_spec (m, real_npoints, lghosts);
@@ -1225,9 +1227,9 @@ namespace Carpet {
}
rvect real_sizes
- = ((sizes - convoffsets)
+ = (rvect (sizes - convoffsets)
/ ipow (rvect (convergence_factor), convpowers * basemglevel)
- + convoffsets);
+ + rvect (convoffsets));
for (int d=gp.dim; d<dim; ++d) {
real_sizes[d] = sizes[d];
}