Skip to content

Commit

Permalink
Use string literals in adapter API of the problem files (*.hh)
Browse files Browse the repository at this point in the history
  • Loading branch information
IshaanDesai committed Dec 19, 2023
1 parent 60c2c38 commit 48ad127
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
10 changes: 3 additions & 7 deletions examples/ff-pm/flow-over-cube-3d/ffproblem-reversed.hh
Original file line number Diff line number Diff line change
Expand Up @@ -219,16 +219,14 @@ public:
PrimaryVariables dirichlet(const Element &element,
const SubControlVolumeFace &scvf) const
{
std::string meshName_("FreeFlowMesh");
std::string dataName_("Velocity");
PrimaryVariables values(0.0);
values = initialAtPos(scvf.center());

const auto faceId = scvf.index();
if (couplingParticipant_.isCoupledEntity(faceId)) {
values[Indices::velocityYIdx] =
couplingParticipant_.getScalarQuantityOnFace(meshName_,
dataName_, faceId);
couplingParticipant_.getScalarQuantityOnFace(
"FreeFlowMesh", "Velocity", faceId);
}

return values;
Expand All @@ -250,8 +248,6 @@ public:
const ElementFaceVariables &elemFaceVars,
const SubControlVolumeFace &scvf) const
{
std::string meshName_("FreeFlowMesh");
std::string dataName_("Pressure");
NumEqVector values(0.0);

const auto faceId = scvf.index();
Expand All @@ -264,7 +260,7 @@ public:
values[Indices::momentumYBalanceIdx] =
scvf.directionSign() *
(couplingParticipant_.getScalarQuantityOnFace(
meshName_, dataName_, faceId) -
"FreeFlowMesh", "Pressure", faceId) -
initialAtPos(scvf.center())[Indices::pressureIdx]);
}
return values;
Expand Down
4 changes: 1 addition & 3 deletions examples/ff-pm/flow-over-cube-3d/pmproblem-reversed.hh
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,14 @@ public:
PrimaryVariables dirichlet(const Element &element,
const SubControlVolumeFace &scvf) const
{
std::string meshName_("DarcyMesh");
std::string dataName_("Pressure");
// set p = 0 at the bottom
PrimaryVariables values(0.0);
values = initial(element);

const auto faceId = scvf.index();
if (couplingParticipant_.isCoupledEntity(faceId))
values = couplingParticipant_.getScalarQuantityOnFace(
meshName_, dataName_, faceId);
"DarcyMesh", "Pressure", faceId);

return values;
}
Expand Down
10 changes: 3 additions & 7 deletions examples/ff-pm/flow-over-square-2d/ffproblem-reversed.hh
Original file line number Diff line number Diff line change
Expand Up @@ -218,16 +218,14 @@ public:
PrimaryVariables dirichlet(const Element &element,
const SubControlVolumeFace &scvf) const
{
std::string meshName_("FreeFlowMesh");
std::string dataName_("Velocity");
PrimaryVariables values(0.0);
values = initialAtPos(scvf.center());

const auto faceId = scvf.index();
if (couplingParticipant_.isCoupledEntity(faceId)) {
values[Indices::velocityYIdx] =
couplingParticipant_.getScalarQuantityOnFace(meshName_,
dataName_, faceId);
couplingParticipant_.getScalarQuantityOnFace(
"FreeFlowMesh", "Velocity", faceId);
}

return values;
Expand All @@ -249,8 +247,6 @@ public:
const ElementFaceVariables &elemFaceVars,
const SubControlVolumeFace &scvf) const
{
std::string meshName_("FreeFlowMesh");
std::string dataName_("Pressure");
NumEqVector values(0.0);

const auto faceId = scvf.index();
Expand All @@ -263,7 +259,7 @@ public:
values[Indices::momentumYBalanceIdx] =
scvf.directionSign() *
(couplingParticipant_.getScalarQuantityOnFace(
meshName_, dataName_, faceId) -
"FreeFlowMesh", "Pressure", faceId) -
initialAtPos(scvf.center())[Indices::pressureIdx]);
}
return values;
Expand Down
4 changes: 1 addition & 3 deletions examples/ff-pm/flow-over-square-2d/pmproblem-reversed.hh
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,14 @@ public:
PrimaryVariables dirichlet(const Element &element,
const SubControlVolumeFace &scvf) const
{
std::string meshName_("DarcyMesh");
std::string dataName_("Pressure");
// set p = 0 at the bottom
PrimaryVariables values(0.0);
values = initial(element);

const auto faceId = scvf.index();
if (couplingParticipant_.isCoupledEntity(faceId))
values = couplingParticipant_.getScalarQuantityOnFace(
meshName_, dataName_, faceId);
"DarcyMesh", "Pressure", faceId);

return values;
}
Expand Down

0 comments on commit 48ad127

Please sign in to comment.