From 48ad127dbe1e753962137011339c15293ea94a06 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Tue, 19 Dec 2023 15:35:20 +0100 Subject: [PATCH] Use string literals in adapter API of the problem files (*.hh) --- examples/ff-pm/flow-over-cube-3d/ffproblem-reversed.hh | 10 +++------- examples/ff-pm/flow-over-cube-3d/pmproblem-reversed.hh | 4 +--- .../ff-pm/flow-over-square-2d/ffproblem-reversed.hh | 10 +++------- .../ff-pm/flow-over-square-2d/pmproblem-reversed.hh | 4 +--- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/examples/ff-pm/flow-over-cube-3d/ffproblem-reversed.hh b/examples/ff-pm/flow-over-cube-3d/ffproblem-reversed.hh index 3243d70..df1bce4 100644 --- a/examples/ff-pm/flow-over-cube-3d/ffproblem-reversed.hh +++ b/examples/ff-pm/flow-over-cube-3d/ffproblem-reversed.hh @@ -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; @@ -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(); @@ -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; diff --git a/examples/ff-pm/flow-over-cube-3d/pmproblem-reversed.hh b/examples/ff-pm/flow-over-cube-3d/pmproblem-reversed.hh index b621aa9..4413b36 100644 --- a/examples/ff-pm/flow-over-cube-3d/pmproblem-reversed.hh +++ b/examples/ff-pm/flow-over-cube-3d/pmproblem-reversed.hh @@ -181,8 +181,6 @@ 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); @@ -190,7 +188,7 @@ public: const auto faceId = scvf.index(); if (couplingParticipant_.isCoupledEntity(faceId)) values = couplingParticipant_.getScalarQuantityOnFace( - meshName_, dataName_, faceId); + "DarcyMesh", "Pressure", faceId); return values; } diff --git a/examples/ff-pm/flow-over-square-2d/ffproblem-reversed.hh b/examples/ff-pm/flow-over-square-2d/ffproblem-reversed.hh index f52b962..4d6109e 100644 --- a/examples/ff-pm/flow-over-square-2d/ffproblem-reversed.hh +++ b/examples/ff-pm/flow-over-square-2d/ffproblem-reversed.hh @@ -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; @@ -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(); @@ -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; diff --git a/examples/ff-pm/flow-over-square-2d/pmproblem-reversed.hh b/examples/ff-pm/flow-over-square-2d/pmproblem-reversed.hh index f22c105..e21868a 100644 --- a/examples/ff-pm/flow-over-square-2d/pmproblem-reversed.hh +++ b/examples/ff-pm/flow-over-square-2d/pmproblem-reversed.hh @@ -180,8 +180,6 @@ 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); @@ -189,7 +187,7 @@ public: const auto faceId = scvf.index(); if (couplingParticipant_.isCoupledEntity(faceId)) values = couplingParticipant_.getScalarQuantityOnFace( - meshName_, dataName_, faceId); + "DarcyMesh", "Pressure", faceId); return values; }