diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2006-06-13 17:17:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2006-06-13 17:17:00 +0000 |
commit | d5a022a661e2099790a88832318dd6b9aa194193 (patch) | |
tree | 18d34b6c52b8845384947eef93c48e335a3ae233 /Carpet/CarpetRegrid/src | |
parent | dad0713a086ae9710d85fbcbd8dde1fcbbfb0102 (diff) |
CarpetRegrid: Explicitly convert from/to CCTK_INT and from/to CCTK_REAL
Explicitly convert between int and CCTK_INT, and between double and
CCTK_REAL, where necessary.
darcs-hash:20060613171732-dae7b-87079cbe961564e3e247bf3bdc3d402cbf42a773.gz
Diffstat (limited to 'Carpet/CarpetRegrid/src')
-rw-r--r-- | Carpet/CarpetRegrid/src/automatic.cc | 5 | ||||
-rw-r--r-- | Carpet/CarpetRegrid/src/manualcoordinatelist.cc | 6 | ||||
-rw-r--r-- | Carpet/CarpetRegrid/src/manualcoordinates.cc | 7 | ||||
-rw-r--r-- | Carpet/CarpetRegrid/src/regrid.cc | 2 |
4 files changed, 12 insertions, 8 deletions
diff --git a/Carpet/CarpetRegrid/src/automatic.cc b/Carpet/CarpetRegrid/src/automatic.cc index f2e9af76b..18079de90 100644 --- a/Carpet/CarpetRegrid/src/automatic.cc +++ b/Carpet/CarpetRegrid/src/automatic.cc @@ -60,7 +60,7 @@ namespace CarpetRegrid { vector<ibbox> bbs; gh::cbnds obs; Automatic_OneLevel - (cctkGH, hh, reflevel, min(reflevels+1, refinement_levels), + (cctkGH, hh, reflevel, min(reflevels+1, (int)refinement_levels), errorgf, bbs, obs); // make multiprocessor aware @@ -214,7 +214,8 @@ namespace CarpetRegrid { if (cnt == 0) { // Don't refine - } else if (any (reffact*width < 2*minwidth) or fraction >= minfraction) { + } else if (any (reffact*width < (int)(2*minwidth)) + or fraction >= minfraction) { // Refine the whole region const ivect lo(region.lower()); const ivect up(region.upper()); diff --git a/Carpet/CarpetRegrid/src/manualcoordinatelist.cc b/Carpet/CarpetRegrid/src/manualcoordinatelist.cc index b993d3a3d..5cc0492e0 100644 --- a/Carpet/CarpetRegrid/src/manualcoordinatelist.cc +++ b/Carpet/CarpetRegrid/src/manualcoordinatelist.cc @@ -177,7 +177,8 @@ namespace CarpetRegrid { // change the parameter file when the convergence level is // changed. rvect const spacing = base_spacing / rvect(spacereffact); - if (! all(abs(ext.stride() - spacing) < spacing * 1.0e-10)) { + if (! all(abs(ext.stride() - spacing) + < spacing * (CCTK_REAL) 1.0e-10)) { assert (dim==3); CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING, "The grid spacing on refinement level %d is incorrect. I expected [%g,%g,%g], but I found [%g,%g,%g].", @@ -185,7 +186,8 @@ namespace CarpetRegrid { double(spacing[0]), double(spacing[1]), double(spacing[2]), double(ext.stride()[0]), double(ext.stride()[1]), double(ext.stride()[2])); } - assert (all(abs(ext.stride() - spacing) < spacing * 1.0e-10)); + assert (all(abs(ext.stride() - spacing) + < spacing * (CCTK_REAL) 1.0e-10)); rvect offset = rvect(0); if (c < num_offsets) { diff --git a/Carpet/CarpetRegrid/src/manualcoordinates.cc b/Carpet/CarpetRegrid/src/manualcoordinates.cc index 0207119e9..03c3c566b 100644 --- a/Carpet/CarpetRegrid/src/manualcoordinates.cc +++ b/Carpet/CarpetRegrid/src/manualcoordinates.cc @@ -122,10 +122,10 @@ namespace CarpetRegrid { const ivect istride = hh.baseextent.stride() / levfac; const ivect ipos - = ivect(floor(rpos * scale / rvect(istride) + 0.5)) * istride; + = ivect(floor(rpos * scale / rvect(istride) + (CCTK_REAL) 0.5)) * istride; const rvect apos = rpos * scale; - assert (all(abs(apos - rvect(ipos)) < rvect(istride)*0.01)); + assert (all(abs(apos - rvect(ipos)) < rvect(istride) * (CCTK_REAL) 0.01)); return ipos; } @@ -152,7 +152,8 @@ namespace CarpetRegrid { const ivect istride = hh.baseextent.stride() / levfac; const ivect ipos - = (ivect(floor((rpos - global_lower) * scale / rvect(istride) + 0.5)) + = (ivect(floor((rpos - global_lower) * scale / rvect(istride) + + (CCTK_REAL) 0.5)) * istride); return ipos; diff --git a/Carpet/CarpetRegrid/src/regrid.cc b/Carpet/CarpetRegrid/src/regrid.cc index 039d2e2a8..b2b91709c 100644 --- a/Carpet/CarpetRegrid/src/regrid.cc +++ b/Carpet/CarpetRegrid/src/regrid.cc @@ -68,7 +68,7 @@ namespace CarpetRegrid { if (cctkGH->cctk_iteration-1 >= activate_next) { const int newnumlevels - = min(refinement_levels + num_new_levels, maxreflevels); + = min((int)(refinement_levels + num_new_levels), maxreflevels); assert (newnumlevels>0 and newnumlevels<=maxreflevels); *const_cast<CCTK_INT*>(&activate_next) = cctkGH->cctk_iteration; |