Skip to content

Commit

Permalink
Skip velocity object from the initializer list (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
MakisH authored Jun 19, 2024
1 parent 3310aae commit 74fb301
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 4 additions & 5 deletions FF/Velocity.C
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@ preciceAdapter::FF::Velocity::Velocity(
const std::string nameU,
const std::string namePhi,
bool fluxCorrection)
: U_(
const_cast<volVectorField*>(
&mesh.lookupObject<volVectorField>(nameU))),
phi_(const_cast<surfaceScalarField*>(
&mesh.lookupObject<surfaceScalarField>(namePhi))),
: phi_(const_cast<surfaceScalarField*>(
&mesh.lookupObject<surfaceScalarField>(namePhi))),
fluxCorrection_(fluxCorrection)
{
if (mesh.foundObject<volVectorField>(nameU))
{
adapterInfo("Using existing velocity object " + nameU, "debug");
U_ = const_cast<volVectorField*>(
&mesh.lookupObject<volVectorField>(nameU));
}
else
{
adapterInfo("Creating a new velocity object " + nameU, "debug");
U_ = new volVectorField(
IOobject(
nameU,
Expand Down
1 change: 1 addition & 0 deletions changelog-entries/330.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixed looking for velocity object that should first be created by the adapter [#330](https://github.com/precice/openfoam-adapter/pull/330).

0 comments on commit 74fb301

Please sign in to comment.