diff --git a/test/multidomain/facet/1p_1p/analytical/CMakeLists.txt b/test/multidomain/facet/1p_1p/analytical/CMakeLists.txt index 0ecd2202e359260598429cbc88916ed3d54c2952..63064c09e8ae5bbe0d1316c2546509fb74bffce3 100644 --- a/test/multidomain/facet/1p_1p/analytical/CMakeLists.txt +++ b/test/multidomain/facet/1p_1p/analytical/CMakeLists.txt @@ -1,32 +1,24 @@ -dune_symlink_to_source_files(FILES "grids" "facetcoupling_1p1p.input" "convergencetest.py") +dune_symlink_to_source_files(FILES "grids" "params.input" "convergencetest.py") -# executable for tpfa tests -add_executable(test_facetcoupling_tpfa_1p1p EXCLUDE_FROM_ALL test_facetcoupling_fv_1p1p.cc) -target_compile_definitions(test_facetcoupling_tpfa_1p1p PUBLIC BULKTYPETAG=OnePBulkTpfa LOWDIMTYPETAG=OnePLowDimTpfa) - -# exectuable for box tests -add_executable(test_facetcoupling_box_1p1p EXCLUDE_FROM_ALL test_facetcoupling_fv_1p1p.cc) -target_compile_definitions(test_facetcoupling_box_1p1p PUBLIC BULKTYPETAG=OnePBulkBox LOWDIMTYPETAG=OnePLowDimBox) - -dune_add_test(NAME test_facet_1p1p_tpfa_convergence +dune_add_test(NAME test_md_facet_1p1p_tpfa_convergence CMAKE_GUARD "( dune-foamgrid_FOUND AND dune-alugrid_FOUND AND gmsh_FOUND AND HAVE_UMFPACK )" - TARGET test_facetcoupling_tpfa_1p1p + SOURCES main.cc + COMPILE_DEFINITIONS BULKTYPETAG=OnePBulkTpfa LOWDIMTYPETAG=OnePLowDimTpfa COMMAND ./convergencetest.py - CMD_ARGS test_facetcoupling_tpfa_1p1p 1e-4) + CMD_ARGS test_md_facet_1p1p_tpfa_convergence 1e-4) -dune_add_test(NAME test_facet_1p1p_box_convergence +dune_add_test(NAME test_md_facet_1p1p_box_convergence CMAKE_GUARD "( dune-foamgrid_FOUND AND dune-alugrid_FOUND AND gmsh_FOUND AND HAVE_UMFPACK )" - TARGET test_facetcoupling_box_1p1p + SOURCES main.cc + COMPILE_DEFINITIONS BULKTYPETAG=OnePBulkBox LOWDIMTYPETAG=OnePLowDimBox COMMAND ./convergencetest.py - CMD_ARGS test_facetcoupling_box_1p1p 1e-4) - -set(CMAKE_BUILD_TYPE Release) + CMD_ARGS test_md_facet_1p1p_box_convergence 1e-4 ) #install sources install(FILES -test_facetcoupling_fv_1p1p.cc -bulkProblem.hh -lowdimproblem.hh +main.cc +problem_bulk.hh +problem_lowdim.hh spatialparams.hh convergencetest.py DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/test/multidomain/facet/1p_1p/analytical) diff --git a/test/multidomain/facet/1p_1p/analytical/convergencetest.py b/test/multidomain/facet/1p_1p/analytical/convergencetest.py index 9fd5be22c73945669bcb07994210d647b323756b..d99bde806f334c180779be90aa82eaadb1dcda30 100755 --- a/test/multidomain/facet/1p_1p/analytical/convergencetest.py +++ b/test/multidomain/facet/1p_1p/analytical/convergencetest.py @@ -50,7 +50,8 @@ for permIndex in range(0, len(k)): tmpGeoFile.close() subprocess.call(['gmsh', '-2', 'grids/tmp.geo']) - subprocess.call(['./' + execName, 'facetcoupling_1p1p.input', + subprocess.call(['./' + execName, 'params.input', + '-Vtk.OutputName', execName, '-Grid.File', 'grids/tmp.msh', '-Grid.NumElemsPerSide', str(int(cells)), '-LowDim.SpatialParams.Permeability', str(k[permIndex]), diff --git a/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc b/test/multidomain/facet/1p_1p/analytical/main.cc similarity index 99% rename from test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc rename to test/multidomain/facet/1p_1p/analytical/main.cc index 39490ae7dc12cbe9bbc0f9499624000b2cc0a94f..85cd06a63bb1338e69fd1c7cfcb29b643163595c 100644 --- a/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc +++ b/test/multidomain/facet/1p_1p/analytical/main.cc @@ -28,8 +28,8 @@ #include <dune/common/parallel/mpihelper.hh> #include <dune/geometry/quadraturerules.hh> -#include "bulkproblem.hh" -#include "lowdimproblem.hh" +#include "problem_bulk.hh" +#include "problem_lowdim.hh" #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> @@ -266,7 +266,7 @@ int main(int argc, char** argv) try bulkGridVariables->init(x[bulkId]); lowDimGridVariables->init(x[lowDimId]); - // intialize the vtk output module + // intialize the vtk output modulell const auto bulkDM = BulkFVGridGeometry::discMethod == DiscretizationMethod::box ? Dune::VTK::nonconforming : Dune::VTK::conforming; using BulkSolutionVector = std::decay_t<decltype(x[bulkId])>; using LowDimSolutionVector = std::decay_t<decltype(x[lowDimId])>; diff --git a/test/multidomain/facet/1p_1p/analytical/facetcoupling_1p1p.input b/test/multidomain/facet/1p_1p/analytical/params.input similarity index 82% rename from test/multidomain/facet/1p_1p/analytical/facetcoupling_1p1p.input rename to test/multidomain/facet/1p_1p/analytical/params.input index 2fb1db270257a82af2967c27c53f0f0095d46f0a..685fa4492401d3aa6fba14a00c5eaf1371aba687 100644 --- a/test/multidomain/facet/1p_1p/analytical/facetcoupling_1p1p.input +++ b/test/multidomain/facet/1p_1p/analytical/params.input @@ -8,12 +8,12 @@ NumElemsPerSide = 25 File = ./grids/hybridgrid.msh [Bulk] -Problem.Name = 1p_1p_bulk SpatialParams.Permeability = 1 +Problem.Name = bulk [LowDim] SpatialParams.Permeability = 1e4 -Problem.Name = 1p_1p_lowdim +Problem.Name = lowdim [L2Error] QuadratureOrder = 1 @@ -23,3 +23,6 @@ NumericDifference.BaseEpsilon = 1e10 [Output] EnableVTK = false # do not write .vtk files per default + +[Vtk] +OutputName = test_md_facet_1p1p diff --git a/test/multidomain/facet/1p_1p/analytical/bulkproblem.hh b/test/multidomain/facet/1p_1p/analytical/problem_bulk.hh similarity index 95% rename from test/multidomain/facet/1p_1p/analytical/bulkproblem.hh rename to test/multidomain/facet/1p_1p/analytical/problem_bulk.hh index eac60f6c71720406f31313bcc7fe0544ab21f7b8..be62c14f1d07c4c00474d670bfebf3f029b456f2 100644 --- a/test/multidomain/facet/1p_1p/analytical/bulkproblem.hh +++ b/test/multidomain/facet/1p_1p/analytical/problem_bulk.hh @@ -95,11 +95,21 @@ class OnePBulkProblem : public PorousMediumFlowProblem<TypeTag> public: OnePBulkProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, std::shared_ptr<typename ParentType::SpatialParams> spatialParams, - const std::string& paramGroup = "") + const std::string& paramGroup = "Bulk") : ParentType(fvGridGeometry, spatialParams, paramGroup) , lowDimPermeability_(getParam<Scalar>("LowDim.SpatialParams.Permeability")) , aperture_(getParam<Scalar>("Problem.FractureAperture")) - {} + { + problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name"); + } + + /*! + * \brief The problem name. + */ + const std::string& name() const + { + return problemName_; + } //! Specifies the type of boundary condition at a given position BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const @@ -191,6 +201,7 @@ private: std::shared_ptr<CouplingManager> couplingManagerPtr_; Scalar lowDimPermeability_; Scalar aperture_; + std::string problemName_; }; } // end namespace Dumux diff --git a/test/multidomain/facet/1p_1p/analytical/lowdimproblem.hh b/test/multidomain/facet/1p_1p/analytical/problem_lowdim.hh similarity index 94% rename from test/multidomain/facet/1p_1p/analytical/lowdimproblem.hh rename to test/multidomain/facet/1p_1p/analytical/problem_lowdim.hh index 72b061cd2984944832e11c545a3542c0b168391a..27474f6d33555b7e238998ca7dbe53d6a64a8c99 100644 --- a/test/multidomain/facet/1p_1p/analytical/lowdimproblem.hh +++ b/test/multidomain/facet/1p_1p/analytical/problem_lowdim.hh @@ -95,10 +95,20 @@ class OnePLowDimProblem : public PorousMediumFlowProblem<TypeTag> public: OnePLowDimProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, std::shared_ptr<typename ParentType::SpatialParams> spatialParams, - const std::string& paramGroup = "") + const std::string& paramGroup = "LowDim") : ParentType(fvGridGeometry, spatialParams, paramGroup) , aperture_(getParam<Scalar>("Problem.FractureAperture")) - {} + { + problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name"); + } + + /*! + * \brief The problem name. + */ + const std::string& name() const + { + return problemName_; + } //! Specifies the type of boundary condition at a given position BoundaryTypes boundaryTypesAtPos(const GlobalPosition& globalPos) const @@ -159,6 +169,7 @@ public: private: std::shared_ptr<CouplingManager> couplingManagerPtr_; Scalar aperture_; + std::string problemName_; }; } // end namespace Dumux diff --git a/test/multidomain/facet/1p_1p/threedomain/CMakeLists.txt b/test/multidomain/facet/1p_1p/threedomain/CMakeLists.txt index f49c711568569d7b9d8cbf38329f6d06643a54ce..3e4e3d639ad9c2663c64b9453d32a76bebbac6a7 100644 --- a/test/multidomain/facet/1p_1p/threedomain/CMakeLists.txt +++ b/test/multidomain/facet/1p_1p/threedomain/CMakeLists.txt @@ -1,25 +1,26 @@ -dune_symlink_to_source_files(FILES "grids" "facetcoupling_1p1p_threedomain.input") +dune_symlink_to_source_files(FILES "grids" "params.input") -dune_add_test(NAME test_facetcoupling_tpfa_1p1p_threedomain - SOURCES test_facetcoupling_tpfa_1p1p_threedomain.cc +dune_add_test(NAME test_md_facet_1p1p_threedomain_tpfa + SOURCES main.cc CMAKE_GUARD "( dune-foamgrid_FOUND AND dune-alugrid_FOUND )" COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py CMD_ARGS --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/facetcoupling_1p1p_threedomain_bulk.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_1p_1p_bulk-00001.vtu - ${CMAKE_SOURCE_DIR}/test/references/facetcoupling_1p1p_threedomain_facet.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_1p_1p_facet-00001.vtu - ${CMAKE_SOURCE_DIR}/test/references/facetcoupling_1p1p_threedomain_edge.vtp - ${CMAKE_CURRENT_BINARY_DIR}/test_1p_1p_edge-00001.vtp - --command "${CMAKE_CURRENT_BINARY_DIR}/test_facetcoupling_tpfa_1p1p_threedomain facetcoupling_1p1p_threedomain.input") + --files ${CMAKE_SOURCE_DIR}/test/references/test_md_facet_1p1p_threedomain_tpfa_bulk-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_md_facet_1p1p_threedomain_tpfa_bulk-00001.vtu + ${CMAKE_SOURCE_DIR}/test/references/test_md_facet_1p1p_threedomain_tpfa_facet-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_md_facet_1p1p_threedomain_tpfa_facet-00001.vtu + ${CMAKE_SOURCE_DIR}/test/references/test_md_facet_1p1p_threedomain_tpfa_edge-reference.vtp + ${CMAKE_CURRENT_BINARY_DIR}/test_md_facet_1p1p_threedomain_tpfa_edge-00001.vtp + --command "${CMAKE_CURRENT_BINARY_DIR}/test_md_facet_1p1p_threedomain_tpfa params.input + -Vtk.OutputName test_md_facet_1p1p_threedomain_tpfa") set(CMAKE_BUILD_TYPE Release) #install sources install(FILES -test_facetcoupling_tpfa_1p1p_threedomain.cc -bulkProblem.hh -facetproblem.hh -edgeproblem.hh +main.cc +problem_bulk.hh +problem_facet.hh +problem_edge.hh spatialparams.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/test/multidomain/facet/1p_1p/threedomain) diff --git a/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc b/test/multidomain/facet/1p_1p/threedomain/main.cc similarity index 98% rename from test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc rename to test/multidomain/facet/1p_1p/threedomain/main.cc index fe8edaccf1a8780ca2fb1bed2e95f368a8f1b35c..ddc08ac3167f245a0a9e07f043584c4390114ab1 100644 --- a/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc +++ b/test/multidomain/facet/1p_1p/threedomain/main.cc @@ -32,9 +32,9 @@ #include <dumux/common/dumuxmessage.hh> #include <dumux/common/defaultusagemessage.hh> -#include "bulkproblem.hh" -#include "facetproblem.hh" -#include "edgeproblem.hh" +#include "problem_bulk.hh" +#include "problem_facet.hh" +#include "problem_edge.hh" #include <dumux/assembly/diffmethod.hh> @@ -178,8 +178,10 @@ int main(int argc, char** argv) try using BulkSolutionVector = std::decay_t<decltype(x[bulkId])>; using FacetSolutionVector = std::decay_t<decltype(x[facetId])>; using EdgeSolutionVector = std::decay_t<decltype(x[edgeId])>; + + // intialize the vtk output module VtkOutputModule<BulkGridVariables, BulkSolutionVector> bulkVtkWriter(*bulkGridVariables, x[bulkId], bulkProblem->name()); - VtkOutputModule<FacetGridVariables, FacetSolutionVector> facetVtkWriter(*facetGridVariables, x[facetId], facetProblem->name()); + VtkOutputModule<FacetGridVariables, FacetSolutionVector> facetVtkWriter(*facetGridVariables, x[facetId], facetProblem->name()); VtkOutputModule<EdgeGridVariables, EdgeSolutionVector> edgeVtkWriter(*edgeGridVariables, x[edgeId], edgeProblem->name()); // Add model specific output fields diff --git a/test/multidomain/facet/1p_1p/threedomain/facetcoupling_1p1p_threedomain.input b/test/multidomain/facet/1p_1p/threedomain/params.input similarity index 72% rename from test/multidomain/facet/1p_1p/threedomain/facetcoupling_1p1p_threedomain.input rename to test/multidomain/facet/1p_1p/threedomain/params.input index edf2dfddd33814d6cbef521408714bfcadcb19f0..bfa6c4f9d07d0ffbce48df086ecc388b169e13d7 100644 --- a/test/multidomain/facet/1p_1p/threedomain/facetcoupling_1p1p_threedomain.input +++ b/test/multidomain/facet/1p_1p/threedomain/params.input @@ -5,7 +5,7 @@ EnableGravity = false File = ./grids/grid.msh [Bulk] -Problem.Name = test_1p_1p_bulk +Problem.Name = bulk SpatialParams.Permeability = 1 FacetCoupling.Xi = 1.0 @@ -14,11 +14,14 @@ Aperture = 1e-2 [Facet] SpatialParams.Permeability = 1e3 -Problem.Name = test_1p_1p_facet +Problem.Name = facet Problem.Aperture = 1e-2 FacetCoupling.Xi = 1.0 [Edge] SpatialParams.Permeability = 1e5 -Problem.Name = test_1p_1p_edge +Problem.Name = edge Problem.Aperture = 1e-3 + +[Vtk] +OutputName = test_md_facet_1p1p_threedomain_tpfa diff --git a/test/multidomain/facet/1p_1p/threedomain/bulkproblem.hh b/test/multidomain/facet/1p_1p/threedomain/problem_bulk.hh similarity index 94% rename from test/multidomain/facet/1p_1p/threedomain/bulkproblem.hh rename to test/multidomain/facet/1p_1p/threedomain/problem_bulk.hh index 3d3998aa82ff9384acb481101221ca66900c5967..49699ac073dfc2927d1230e5b9c61f0511c053a2 100644 --- a/test/multidomain/facet/1p_1p/threedomain/bulkproblem.hh +++ b/test/multidomain/facet/1p_1p/threedomain/problem_bulk.hh @@ -96,9 +96,19 @@ public: //! The constructor OnePBulkProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, std::shared_ptr<typename ParentType::SpatialParams> spatialParams, - const std::string& paramGroup = "") + const std::string& paramGroup = "Bulk") : ParentType(fvGridGeometry, spatialParams, paramGroup) - {} + { + problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name"); + } + + /*! + * \brief The problem name. + */ + const std::string& name() const + { + return problemName_; + } //! Specifies the kind of boundary condition on a given boundary position. BoundaryTypes boundaryTypesAtPos(const GlobalPosition& globalPos) const @@ -152,6 +162,7 @@ public: { couplingManagerPtr_ = cm; } private: + std::string problemName_; std::shared_ptr<CouplingManager> couplingManagerPtr_; }; diff --git a/test/multidomain/facet/1p_1p/threedomain/edgeproblem.hh b/test/multidomain/facet/1p_1p/threedomain/problem_edge.hh similarity index 94% rename from test/multidomain/facet/1p_1p/threedomain/edgeproblem.hh rename to test/multidomain/facet/1p_1p/threedomain/problem_edge.hh index f9fcfcabf01bae3607d039c313b31b45fde4d423..1274935d2f9acdc6b6843c6d7af9986fdb8ea235 100644 --- a/test/multidomain/facet/1p_1p/threedomain/edgeproblem.hh +++ b/test/multidomain/facet/1p_1p/threedomain/problem_edge.hh @@ -100,11 +100,20 @@ public: //! The constructor OnePEdgeProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, std::shared_ptr<typename ParentType::SpatialParams> spatialParams, - const std::string& paramGroup = "") + const std::string& paramGroup = "Edge") : ParentType(fvGridGeometry, spatialParams, paramGroup) { const auto a = getParam<Scalar>("Extrusion.Aperture"); exFactor_ = a*a; + problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name"); + } + + /*! + * \brief The problem name. + */ + const std::string& name() const + { + return problemName_; } //!Specifies the type of boundary condition on a boundary position @@ -152,6 +161,7 @@ public: private: Scalar exFactor_; + std::string problemName_; std::shared_ptr<CouplingManager> couplingManagerPtr_; }; diff --git a/test/multidomain/facet/1p_1p/threedomain/facetproblem.hh b/test/multidomain/facet/1p_1p/threedomain/problem_facet.hh similarity index 94% rename from test/multidomain/facet/1p_1p/threedomain/facetproblem.hh rename to test/multidomain/facet/1p_1p/threedomain/problem_facet.hh index a72c5af1f927cc0e74700c3a0504510eacf2346f..6da834a064c4df28e9eaa0404de63a1858f240bb 100644 --- a/test/multidomain/facet/1p_1p/threedomain/facetproblem.hh +++ b/test/multidomain/facet/1p_1p/threedomain/problem_facet.hh @@ -100,10 +100,20 @@ public: //! The constructor OnePFacetProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, std::shared_ptr<typename ParentType::SpatialParams> spatialParams, - const std::string& paramGroup = "") + const std::string& paramGroup = "Facet") : ParentType(fvGridGeometry, spatialParams, paramGroup) , aperture_(getParam<Scalar>("Extrusion.Aperture")) - {} + { + problemName_ = getParam<std::string>("Vtk.OutputName") + "_" + getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name"); + } + + /*! + * \brief The problem name. + */ + const std::string& name() const + { + return problemName_; + } //! Specifies the kind of boundary condition at a boundary position BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const @@ -165,6 +175,7 @@ public: private: Scalar aperture_; + std::string problemName_; std::shared_ptr<CouplingManager> couplingManagerPtr_; }; diff --git a/test/references/facetcoupling_1p1p_threedomain_bulk.vtu b/test/references/test_md_facet_1p1p_threedomain_tpfa_bulk-reference.vtu similarity index 100% rename from test/references/facetcoupling_1p1p_threedomain_bulk.vtu rename to test/references/test_md_facet_1p1p_threedomain_tpfa_bulk-reference.vtu diff --git a/test/references/facetcoupling_1p1p_threedomain_edge.vtp b/test/references/test_md_facet_1p1p_threedomain_tpfa_edge-reference.vtp similarity index 100% rename from test/references/facetcoupling_1p1p_threedomain_edge.vtp rename to test/references/test_md_facet_1p1p_threedomain_tpfa_edge-reference.vtp diff --git a/test/references/facetcoupling_1p1p_threedomain_facet.vtu b/test/references/test_md_facet_1p1p_threedomain_tpfa_facet-reference.vtu similarity index 100% rename from test/references/facetcoupling_1p1p_threedomain_facet.vtu rename to test/references/test_md_facet_1p1p_threedomain_tpfa_facet-reference.vtu