Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add isFci for fields #2887

Open
wants to merge 12 commits into
base: next
Choose a base branch
from
5 changes: 3 additions & 2 deletions include/bout/coordinates.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ public:
transform = std::move(pt);
}

bool hasParallelTransform() const { return transform != nullptr; }
/// Return the parallel transform
ParallelTransform& getParallelTransform() {
ASSERT1(transform != nullptr);
ParallelTransform& getParallelTransform() const {
ASSERT1(hasParallelTransform());
return *transform;
}

Expand Down
2 changes: 2 additions & 0 deletions include/bout/field.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ public:

std::string name;

bool isFci() const;

#if CHECK > 0
// Routines to test guard/boundary cells set

Expand Down
11 changes: 11 additions & 0 deletions src/field/field.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,14 @@ int Field::getNx() const { return getMesh()->LocalNx; }
int Field::getNy() const { return getMesh()->LocalNy; }

int Field::getNz() const { return getMesh()->LocalNz; }

bool Field::isFci() const {
const auto coords = this->getCoordinates();
dschwoerer marked this conversation as resolved.
Show resolved Hide resolved
if (coords == nullptr) {
return false;
}
if (not coords->hasParallelTransform()) {
return false;
}
return not coords->getParallelTransform().canToFromFieldAligned();
}
Loading