From e6c6657ec1774cdfcd493087b99ef7f1c4591f02 Mon Sep 17 00:00:00 2001 From: Alexander Jaust <alexander.jaust@ipvs.uni-stuttgart.de> Date: Wed, 12 Jun 2019 17:42:33 +0200 Subject: [PATCH] adapted to new precice adapter --- appl/coupling-ff-pm/iterative/main_ff.cc | 12 ++++++------ appl/coupling-ff-pm/iterative/main_pm.cc | 12 ++++++------ appl/coupling-ff-pm/monolithic/ffproblem.hh | 2 +- appl/coupling-ff-pm/monolithic/pmproblem.hh | 2 +- appl/precice-adapter | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/appl/coupling-ff-pm/iterative/main_ff.cc b/appl/coupling-ff-pm/iterative/main_ff.cc index 30e58b7..7a86f38 100644 --- a/appl/coupling-ff-pm/iterative/main_ff.cc +++ b/appl/coupling-ff-pm/iterative/main_ff.cc @@ -88,7 +88,7 @@ void setInterfaceVelocities(const Problem& problem, { //TODO: What to do here? const auto v = velocityAtInterface(elemFaceVars, scvf)[scvf.directionIndex()]; - couplingInterface.writeQuantityOnFace( velocityId, scvf.index(), v ); + couplingInterface.writeScalarQuantityOnFace( velocityId, scvf.index(), v ); } } } @@ -184,8 +184,8 @@ int main(int argc, char** argv) try const auto numberOfPoints = coords.size() / dim; const double preciceDt = couplingInterface.setMeshAndInitialize( "FreeFlowMesh", numberOfPoints, - coords, - coupledScvfIndices ); + coords); + couplingInterface.createIndexMapping( coupledScvfIndices ); const auto velocityId = couplingInterface.announceQuantity( "Velocity" ); const auto pressureId = couplingInterface.announceQuantity( "Pressure" ); @@ -211,7 +211,7 @@ int main(int argc, char** argv) try //TODO // couplingInterface.writeQuantityVector( pressureId ); setInterfaceVelocities( *freeFlowProblem, *freeFlowGridVariables, sol ); - couplingInterface.writeQuantityToOtherSolver( velocityId ); + couplingInterface.writeScalarQuantityToOtherSolver( velocityId ); couplingInterface.announceInitialDataWritten(); } couplingInterface.initializeData(); @@ -242,14 +242,14 @@ int main(int argc, char** argv) try } // TODO - couplingInterface.readQuantityFromOtherSolver( pressureId ); + couplingInterface.readScalarQuantityFromOtherSolver( pressureId ); // solve the non-linear system nonLinearSolver.solve(sol); // TODO setInterfaceVelocities( *freeFlowProblem, *freeFlowGridVariables, sol ); - couplingInterface.writeQuantityToOtherSolver( velocityId ); + couplingInterface.writeScalarQuantityToOtherSolver( velocityId ); const double preciceDt = couplingInterface.advance( dt ); dt = std::min( preciceDt, dt ); diff --git a/appl/coupling-ff-pm/iterative/main_pm.cc b/appl/coupling-ff-pm/iterative/main_pm.cc index f96b9e1..ef5952e 100644 --- a/appl/coupling-ff-pm/iterative/main_pm.cc +++ b/appl/coupling-ff-pm/iterative/main_pm.cc @@ -113,7 +113,7 @@ { //TODO: What to do here? const double p = pressureAtInterface(problem, element, fvGridGeometry, elemVolVars, scvf); - couplingInterface.writeQuantityOnFace( pressureId, scvf.index(), p ); + couplingInterface.writeScalarQuantityOnFace( pressureId, scvf.index(), p ); } } } @@ -204,8 +204,8 @@ int main(int argc, char** argv) try const auto numberOfPoints = coords.size() / dim; const double preciceDt = couplingInterface.setMeshAndInitialize( "DarcyMesh", numberOfPoints, - coords, - coupledScvfIndices ); + coords); + couplingInterface.createIndexMapping( coupledScvfIndices ); const auto velocityId = couplingInterface.announceQuantity( "Velocity" ); const auto pressureId = couplingInterface.announceQuantity( "Pressure" ); @@ -234,7 +234,7 @@ int main(int argc, char** argv) try //TODO //couplingInterface.writeQuantityVector(velocityId); setInterfacePressures( *darcyProblem, *darcyGridVariables, sol ); - couplingInterface.writeQuantityToOtherSolver( pressureId ); + couplingInterface.writeScalarQuantityToOtherSolver( pressureId ); couplingInterface.announceInitialDataWritten(); } couplingInterface.initializeData(); @@ -264,12 +264,12 @@ int main(int argc, char** argv) try } // TODO - couplingInterface.readQuantityFromOtherSolver( velocityId ); + couplingInterface.readScalarQuantityFromOtherSolver( velocityId ); // solve the non-linear system nonLinearSolver.solve(sol); setInterfacePressures( *darcyProblem, *darcyGridVariables, sol ); - couplingInterface.writeQuantityToOtherSolver( pressureId ); + couplingInterface.writeScalarQuantityToOtherSolver( pressureId ); const double preciceDt = couplingInterface.advance( dt ); dt = std::min( preciceDt, dt ); diff --git a/appl/coupling-ff-pm/monolithic/ffproblem.hh b/appl/coupling-ff-pm/monolithic/ffproblem.hh index 1642fac..f1b4c4a 100644 --- a/appl/coupling-ff-pm/monolithic/ffproblem.hh +++ b/appl/coupling-ff-pm/monolithic/ffproblem.hh @@ -254,7 +254,7 @@ public: { const Scalar density = 1000; // TODO how to handle compressible fluids? values[Indices::conti0EqIdx] = elemFaceVars[scvf].velocitySelf() * scvf.directionSign() * density; - values[Indices::momentumYBalanceIdx] = scvf.directionSign() * (couplingInterface_.getQuantityOnFace( pressureId_, faceId ) - initialAtPos(scvf.center())[Indices::pressureIdx]) ; + values[Indices::momentumYBalanceIdx] = scvf.directionSign() * (couplingInterface_.getScalarQuantityOnFace( pressureId_, faceId ) - initialAtPos(scvf.center())[Indices::pressureIdx]) ; } #endif diff --git a/appl/coupling-ff-pm/monolithic/pmproblem.hh b/appl/coupling-ff-pm/monolithic/pmproblem.hh index c097246..56a1a4b 100644 --- a/appl/coupling-ff-pm/monolithic/pmproblem.hh +++ b/appl/coupling-ff-pm/monolithic/pmproblem.hh @@ -220,7 +220,7 @@ DarcySubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) if ( couplingInterface_.isCoupledEntity(faceId) ) { const Scalar density = 1000.; - values[Indices::conti0EqIdx] = density * couplingInterface_.getQuantityOnFace( velocityId_, faceId ); + values[Indices::conti0EqIdx] = density * couplingInterface_.getScalarQuantityOnFace( velocityId_, faceId ); } #endif return values; diff --git a/appl/precice-adapter b/appl/precice-adapter index e3831bc..51f724e 160000 --- a/appl/precice-adapter +++ b/appl/precice-adapter @@ -1 +1 @@ -Subproject commit e3831bc787ebf9dfae27c88a7c0492af1ec1391b +Subproject commit 51f724ee6cef653c99e99d78fa54066864a714a2 -- GitLab