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

Call initPatch in SIMbase::project #569

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions src/SIM/SIMbase.C
Original file line number Diff line number Diff line change
Expand Up @@ -2136,6 +2136,7 @@ bool SIMbase::project (RealArray& values, const FunctionBase* f,
for (size_t j = 0; j < myModel.size() && ok; j++)
{
if (myModel[j]->empty()) continue; // skip empty patches
f->initPatch(j);

Vector loc_values;
switch (pMethod) {
Expand Down
2 changes: 1 addition & 1 deletion src/Utility/FieldFunctions.C
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ FieldFuncBase::~FieldFuncBase ()
}


bool FieldFuncBase::setPatch (size_t pIdx)
bool FieldFuncBase::setPatch (size_t pIdx) const
{
if (pIdx >= npch)
return false;
Expand Down
6 changes: 3 additions & 3 deletions src/Utility/FieldFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ class FieldFuncBase
virtual ~FieldFuncBase();

//! \brief Sets the active patch.
bool setPatch(size_t pIdx);
bool setPatch(size_t pIdx) const;

protected:
std::vector<ASMbase*> patch; //!< The patches on which the field is defined

size_t pidx; //!< Current patch index
mutable size_t pidx; //!< Current patch index
size_t npch; //!< Number of patches in the field
};

Expand Down Expand Up @@ -170,7 +170,7 @@ class FieldFunction : public RealFunc, public FieldFuncScalarBase
virtual ~FieldFunction() {}

//! \brief Sets the active patch.
virtual bool initPatch(size_t pIdx) { return this->setPatch(pIdx); }
virtual bool initPatch(size_t pIdx) const { return this->setPatch(pIdx); }

protected:
//! \brief Evaluates the scalar field function.
Expand Down
2 changes: 1 addition & 1 deletion src/Utility/Function.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class FunctionBase
size_t dim() const { return ncmp; }

//! \brief Sets the active patch.
virtual bool initPatch(size_t) { return true; }
virtual bool initPatch(size_t) const { return true; }

//! \brief Checks if a specified point is within the function domain.
virtual bool inDomain(const Vec3&) const { return true; }
Expand Down