Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/mesh/parallel/fci.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ FCIMap::FCIMap(Mesh& mesh, int offset_, BoundaryRegionPar* boundary, bool zperio
Field3D FCIMap::integrate(Field3D &f) const {
TRACE("FCIMap::integrate");

ASSERT3(&map_mesh == f.getMesh());
ASSERT1(&map_mesh == f.getMesh());

// Cell centre values
Field3D centre = interp->interpolate(f);
Expand Down Expand Up @@ -316,6 +316,10 @@ Field3D FCIMap::integrate(Field3D &f) const {
void FCITransform::calcYUpDown(Field3D& f) {
TRACE("FCITransform::calcYUpDown");

// Only have forward_map/backward_map for CELL_CENTRE, so can only deal with
// CELL_CENTRE inputs
ASSERT1(f.getLocation() == CELL_CENTRE);

// Ensure that yup and ydown are different fields
f.splitYupYdown();

Expand All @@ -328,6 +332,10 @@ void FCITransform::calcYUpDown(Field3D& f) {
void FCITransform::integrateYUpDown(Field3D& f) {
TRACE("FCITransform::integrateYUpDown");

// Only have forward_map/backward_map for CELL_CENTRE, so can only deal with
// CELL_CENTRE inputs
ASSERT1(f.getLocation() == CELL_CENTRE);

// Ensure that yup and ydown are different fields
f.splitYupYdown();

Expand Down
2 changes: 1 addition & 1 deletion src/mesh/parallel/fci.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public:
BoutMask corner_boundary_mask;

Field3D interpolate(Field3D& f) const {
ASSERT3(&map_mesh == f.getMesh());
ASSERT1(&map_mesh == f.getMesh());
return interp->interpolate(f);
}

Expand Down
5 changes: 5 additions & 0 deletions src/mesh/parallel/shiftedmetric.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ const Field3D ShiftedMetric::fromFieldAligned(const Field3D &f) {

const Field3D ShiftedMetric::shiftZ(const Field3D &f, const arr3Dvec &phs) const {
ASSERT1(&mesh == f.getMesh());
ASSERT1(f.getLocation() == CELL_CENTRE); // only have zShift for CELL_CENTRE, so can only deal with CELL_CENTRE inputs
if(mesh.LocalNz == 1)
return f; // Shifting makes no difference

Expand Down Expand Up @@ -187,6 +188,9 @@ void ShiftedMetric::shiftZ(const BoutReal* in, const Array<dcomplex>& phs,

void ShiftedMetric::calcYUpDown(Field3D& f) {

ASSERT1(&mesh == f.getMesh());
ASSERT1(f.getLocation() == CELL_CENTRE); // only have zShift for CELL_CENTRE, so can only deal with CELL_CENTRE inputs

auto results = shiftZ(f, parallel_slice_phases);

ASSERT3(results.size() == parallel_slice_phases.size());
Expand Down Expand Up @@ -248,6 +252,7 @@ ShiftedMetric::shiftZ(const Field3D& f,
//Old approach retained so we can still specify a general zShift
const Field3D ShiftedMetric::shiftZ(const Field3D &f, const Field2D &zangle) const {
ASSERT1(&mesh == f.getMesh());
ASSERT1(f.getLocation() == zangle.getLocation());
if(mesh.LocalNz == 1)
return f; // Shifting makes no difference

Expand Down