Commit 9cd17b21 authored by Timo Koch's avatar Timo Koch
Browse files

[test][md][embedded] Separate properties into header

parent e8178c0f
......@@ -25,7 +25,6 @@
#include <config.h>
#include <ctime>
#include <iostream>
#include <fstream>
......@@ -37,47 +36,20 @@
#include <dumux/common/dumuxmessage.hh>
#include <dumux/linear/seqsolverbackend.hh>
#include <dumux/assembly/fvassembler.hh>
#include <dumux/assembly/diffmethod.hh>
#include <dumux/discretization/method.hh>
#include <dumux/io/vtkoutputmodule.hh>
#include <dumux/io/grid/gridmanager.hh>
#include <dumux/io/grid/gridmanager_ug.hh>
#include <dumux/io/grid/gridmanager_yasp.hh>
#include <dumux/io/grid/gridmanager_foam.hh>
#include <dumux/multidomain/traits.hh>
#include <dumux/multidomain/fvassembler.hh>
#include <dumux/multidomain/newtonsolver.hh>
#include <dumux/multidomain/embedded/couplingmanager1d3d.hh>
#include <dumux/multidomain/glue.hh>
#include "problem_root.hh"
#include "problem_soil.hh"
#include "properties.hh"
namespace Dumux {
namespace Properties {
template<class TypeTag>
struct CouplingManager<TypeTag, TTag::Soil>
{
using Traits = MultiDomainTraits<TypeTag, Properties::TTag::Root>;
using type = Embedded1d3dCouplingManager<Traits, Embedded1d3dCouplingMode::Average>;
};
template<class TypeTag>
struct CouplingManager<TypeTag, TTag::Root>
{
using Traits = MultiDomainTraits<Properties::TTag::Soil, TypeTag>;
using type = Embedded1d3dCouplingManager<Traits, Embedded1d3dCouplingMode::Average>;
};
template<class TypeTag>
struct PointSource<TypeTag, TTag::Soil> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSource<0>; };
template<class TypeTag>
struct PointSource<TypeTag, TTag::Root> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSource<1>; };
template<class TypeTag>
struct PointSourceHelper<TypeTag, TTag::Soil> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSourceHelper<0>; };
template<class TypeTag>
struct PointSourceHelper<TypeTag, TTag::Root> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSourceHelper<1>; };
} // end namespace Properties
//! Helper function for mass balance evaluations
template<class Problem, class SolutionVector, class GridVariables>
......
......@@ -26,74 +26,13 @@
#ifndef DUMUX_ROOT_PROBLEM_HH
#define DUMUX_ROOT_PROBLEM_HH
#include <dune/foamgrid/foamgrid.hh>
#include <dumux/common/boundarytypes.hh>
#include <dumux/common/parameters.hh>
#include <dumux/common/properties.hh>
#include <dumux/discretization/cctpfa.hh>
#include <dumux/porousmediumflow/1pnc/model.hh>
#include <dumux/porousmediumflow/problem.hh>
#include <dumux/material/components/simpleh2o.hh>
#include <dumux/material/components/constant.hh>
#include <dumux/material/fluidsystems/liquidphase2c.hh>
#include "spatialparams_root.hh"
namespace Dumux {
// forward declaration
template <class TypeTag> class RootProblem;
namespace Properties {
// Create new type tags
namespace TTag {
struct Root { using InheritsFrom = std::tuple<OnePNC, CCTpfaModel>; };
} // end namespace TTag
// Set the grid type
template<class TypeTag>
struct Grid<TypeTag, TTag::Root> { using type = Dune::FoamGrid<1, 3>; };
template<class TypeTag>
struct EnableGridGeometryCache<TypeTag, TTag::Root> { static constexpr bool value = true; };
template<class TypeTag>
struct EnableGridVolumeVariablesCache<TypeTag, TTag::Root> { static constexpr bool value = true; };
template<class TypeTag>
struct EnableGridFluxVariablesCache<TypeTag, TTag::Root> { static constexpr bool value = true; };
template<class TypeTag>
struct SolutionDependentAdvection<TypeTag, TTag::Root> { static constexpr bool value = false; };
template<class TypeTag>
struct SolutionDependentMolecularDiffusion<TypeTag, TTag::Root> { static constexpr bool value = false; };
template<class TypeTag>
struct SolutionDependentHeatConduction<TypeTag, TTag::Root> { static constexpr bool value = false; };
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::Root> { using type = RootProblem<TypeTag>; };
// Set the fluid system
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::Root>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = FluidSystems::LiquidPhaseTwoC<Scalar, Components::SimpleH2O<Scalar>,
Components::Constant<1, Scalar>>;
};
// Set the spatial parameters
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::Root>
{
using type = RootSpatialParams<GetPropType<TypeTag, Properties::GridGeometry>,
GetPropType<TypeTag, Properties::Scalar>>;
};
template<class TypeTag>
struct UseMoles<TypeTag, TTag::Root> { static constexpr bool value = true; };
} // end namespace Properties
/*!
* \ingroup EmbeddedTests
......
......@@ -27,85 +27,17 @@
#define DUMUX_TISSUE_PROBLEM_HH
#include <dune/geometry/quadraturerules.hh>
#include <dune/grid/yaspgrid.hh>
#include <dune/grid/uggrid.hh>
#include <dune/localfunctions/lagrange/pqkfactory.hh>
#include <dumux/common/boundarytypes.hh>
#include <dumux/common/math.hh>
#include <dumux/common/parameters.hh>
#include <dumux/common/properties.hh>
#include <dumux/discretization/cctpfa.hh>
#include <dumux/porousmediumflow/richardsnc/model.hh>
#include <dumux/porousmediumflow/problem.hh>
#include <dumux/material/components/simpleh2o.hh>
#include <dumux/material/components/constant.hh>
#include <dumux/material/fluidsystems/liquidphase2c.hh>
#include "spatialparams_soil.hh"
namespace Dumux {
template <class TypeTag>
class SoilProblem;
namespace Properties {
// Create new type tags
namespace TTag {
struct Soil { using InheritsFrom = std::tuple<RichardsNC, CCTpfaModel>; };
} // end namespace TTag
// Set the grid type
#if HAVE_UG
template<class TypeTag>
struct Grid<TypeTag, TTag::Soil> { using type = Dune::UGGrid<3>; };
#else
template<class TypeTag>
struct Grid<TypeTag, TTag::Soil> { using type = Dune::YaspGrid<3, Dune::EquidistantOffsetCoordinates<double, 3>>; };
#endif
template<class TypeTag>
struct EnableGridGeometryCache<TypeTag, TTag::Soil> { static constexpr bool value = true; };
template<class TypeTag>
struct EnableGridVolumeVariablesCache<TypeTag, TTag::Soil> { static constexpr bool value = true; };
template<class TypeTag>
struct EnableGridFluxVariablesCache<TypeTag, TTag::Soil> { static constexpr bool value = true; };
template<class TypeTag>
struct SolutionDependentAdvection<TypeTag, TTag::Soil> { static constexpr bool value = false; };
template<class TypeTag>
struct SolutionDependentMolecularDiffusion<TypeTag, TTag::Soil> { static constexpr bool value = false; };
template<class TypeTag>
struct SolutionDependentHeatConduction<TypeTag, TTag::Soil> { static constexpr bool value = false; };
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::Soil> { using type = SoilProblem<TypeTag>; };
// Set the spatial parameters
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::Soil>
{
using type = SoilSpatialParams<GetPropType<TypeTag, Properties::GridGeometry>,
GetPropType<TypeTag, Properties::Scalar>>;
};
// Set the fluid system
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::Soil>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = FluidSystems::LiquidPhaseTwoC<Scalar, Components::SimpleH2O<Scalar>,
Components::Constant<1, Scalar>>;
};
template<class TypeTag>
struct UseMoles<TypeTag, TTag::Soil> { static constexpr bool value = true; };
} // end namespace Properties
/*!
* \ingroup EmbeddedTests
* \brief Definition of a problem, for the 1p2c problem:
......
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
* \ingroup EmbeddedTests
* \brief The properties for the one-phase soil problem.
*/
#ifndef DUMUX_TISSUE_PROPERTIES_HH
#define DUMUX_TISSUE_PROPERTIES_HH
#include <dune/grid/yaspgrid.hh>
#include <dune/grid/uggrid.hh>
#include <dune/foamgrid/foamgrid.hh>
#include <dumux/common/properties.hh>
#include <dumux/discretization/cctpfa.hh>
#include <dumux/porousmediumflow/richardsnc/model.hh>
#include <dumux/porousmediumflow/1pnc/model.hh>
#include <dumux/material/components/simpleh2o.hh>
#include <dumux/material/components/constant.hh>
#include <dumux/material/fluidsystems/liquidphase2c.hh>
#include <dumux/multidomain/embedded/couplingmanager1d3d.hh>
#include "problem_soil.hh"
#include "problem_root.hh"
#include "spatialparams_soil.hh"
#include "spatialparams_root.hh"
namespace Dumux::Properties {
// Create new type tags
namespace TTag {
struct Soil { using InheritsFrom = std::tuple<RichardsNC, CCTpfaModel>; };
} // end namespace TTag
// Set the grid type
#if HAVE_UG
template<class TypeTag>
struct Grid<TypeTag, TTag::Soil> { using type = Dune::UGGrid<3>; };
#else
template<class TypeTag>
struct Grid<TypeTag, TTag::Soil> { using type = Dune::YaspGrid<3, Dune::EquidistantOffsetCoordinates<double, 3>>; };
#endif
template<class TypeTag>
struct EnableGridGeometryCache<TypeTag, TTag::Soil> { static constexpr bool value = true; };
template<class TypeTag>
struct EnableGridVolumeVariablesCache<TypeTag, TTag::Soil> { static constexpr bool value = true; };
template<class TypeTag>
struct EnableGridFluxVariablesCache<TypeTag, TTag::Soil> { static constexpr bool value = true; };
template<class TypeTag>
struct SolutionDependentAdvection<TypeTag, TTag::Soil> { static constexpr bool value = false; };
template<class TypeTag>
struct SolutionDependentMolecularDiffusion<TypeTag, TTag::Soil> { static constexpr bool value = false; };
template<class TypeTag>
struct SolutionDependentHeatConduction<TypeTag, TTag::Soil> { static constexpr bool value = false; };
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::Soil> { using type = SoilProblem<TypeTag>; };
// Set the spatial parameters
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::Soil>
{
using type = SoilSpatialParams<GetPropType<TypeTag, Properties::GridGeometry>,
GetPropType<TypeTag, Properties::Scalar>>;
};
// Set the fluid system
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::Soil>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = FluidSystems::LiquidPhaseTwoC<Scalar, Components::SimpleH2O<Scalar>,
Components::Constant<1, Scalar>>;
};
template<class TypeTag>
struct UseMoles<TypeTag, TTag::Soil> { static constexpr bool value = true; };
// Create new type tags
namespace TTag {
struct Root { using InheritsFrom = std::tuple<OnePNC, CCTpfaModel>; };
} // end namespace TTag
// Set the grid type
template<class TypeTag>
struct Grid<TypeTag, TTag::Root> { using type = Dune::FoamGrid<1, 3>; };
template<class TypeTag>
struct EnableGridGeometryCache<TypeTag, TTag::Root> { static constexpr bool value = true; };
template<class TypeTag>
struct EnableGridVolumeVariablesCache<TypeTag, TTag::Root> { static constexpr bool value = true; };
template<class TypeTag>
struct EnableGridFluxVariablesCache<TypeTag, TTag::Root> { static constexpr bool value = true; };
template<class TypeTag>
struct SolutionDependentAdvection<TypeTag, TTag::Root> { static constexpr bool value = false; };
template<class TypeTag>
struct SolutionDependentMolecularDiffusion<TypeTag, TTag::Root> { static constexpr bool value = false; };
template<class TypeTag>
struct SolutionDependentHeatConduction<TypeTag, TTag::Root> { static constexpr bool value = false; };
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::Root> { using type = RootProblem<TypeTag>; };
// Set the fluid system
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::Root>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = FluidSystems::LiquidPhaseTwoC<Scalar, Components::SimpleH2O<Scalar>,
Components::Constant<1, Scalar>>;
};
// Set the spatial parameters
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::Root>
{
using type = RootSpatialParams<GetPropType<TypeTag, Properties::GridGeometry>,
GetPropType<TypeTag, Properties::Scalar>>;
};
template<class TypeTag>
struct UseMoles<TypeTag, TTag::Root> { static constexpr bool value = true; };
template<class TypeTag>
struct CouplingManager<TypeTag, TTag::Soil>
{
using Traits = MultiDomainTraits<TypeTag, Properties::TTag::Root>;
using type = Embedded1d3dCouplingManager<Traits, Embedded1d3dCouplingMode::Average>;
};
template<class TypeTag>
struct CouplingManager<TypeTag, TTag::Root>
{
using Traits = MultiDomainTraits<Properties::TTag::Soil, TypeTag>;
using type = Embedded1d3dCouplingManager<Traits, Embedded1d3dCouplingMode::Average>;
};
template<class TypeTag>
struct PointSource<TypeTag, TTag::Soil> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSource<0>; };
template<class TypeTag>
struct PointSource<TypeTag, TTag::Root> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSource<1>; };
template<class TypeTag>
struct PointSourceHelper<TypeTag, TTag::Soil> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSourceHelper<0>; };
template<class TypeTag>
struct PointSourceHelper<TypeTag, TTag::Root> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSourceHelper<1>; };
} // end namespace Dumux::Properties
#endif
......@@ -36,7 +36,6 @@
#include <dumux/common/dumuxmessage.hh>
#include <dumux/geometry/diameter.hh>
#include <dumux/linear/seqsolverbackend.hh>
#include <dumux/assembly/diffmethod.hh>
#include <dumux/io/vtkoutputmodule.hh>
#include <dumux/io/grid/gridmanager_yasp.hh>
#include <dumux/io/grid/gridmanager_foam.hh>
......@@ -44,46 +43,10 @@
#include <dumux/multidomain/traits.hh>
#include <dumux/multidomain/fvassembler.hh>
#include <dumux/multidomain/newtonsolver.hh>
#include <dumux/multidomain/embedded/couplingmanager1d3d.hh>
#include "problem_bloodflow.hh"
#include "problem_tissue.hh"
#include "properties.hh"
#include "l2norm.hh"
// default to tpfa for both domains
#ifndef BULKTYPETAG
#define BULKTYPETAG=TissueCC
#endif
#ifndef LOWDIMTYPETAG
#define LOWDIMTYPETAG=BloodFlowCC
#endif
#ifndef COUPLINGMODE
#define COUPLINGMODE=Embedded1d3dCouplingMode::Average
#endif
namespace Dumux {
namespace Properties {
template<class Traits>
using TheCouplingManager = Embedded1d3dCouplingManager<Traits, COUPLINGMODE>;
template<class TypeTag>
struct CouplingManager<TypeTag, TTag::BULKTYPETAG> { using type = TheCouplingManager<MultiDomainTraits<TypeTag, Properties::TTag::LOWDIMTYPETAG>>; };
template<class TypeTag>
struct PointSource<TypeTag, TTag::BULKTYPETAG> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSource<0>; };
template<class TypeTag>
struct PointSourceHelper<TypeTag, TTag::BULKTYPETAG> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSourceHelper<0>; };
template<class TypeTag>
struct CouplingManager<TypeTag, TTag::LOWDIMTYPETAG> { using type = TheCouplingManager<MultiDomainTraits<Properties::TTag::BULKTYPETAG, TypeTag>>; };
template<class TypeTag>
struct PointSource<TypeTag, TTag::LOWDIMTYPETAG> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSource<1>; };
template<class TypeTag>
struct PointSourceHelper<TypeTag, TTag::LOWDIMTYPETAG> { using type = typename GetPropType<TypeTag, Properties::CouplingManager>::PointSourceTraits::template PointSourceHelper<1>; };
} // end namespace Properties
} // end namespace Dumux
int main(int argc, char** argv)
{
using namespace Dumux;
......
......@@ -26,79 +26,15 @@
#ifndef DUMUX_BLOOD_FLOW_PROBLEM_HH
#define DUMUX_BLOOD_FLOW_PROBLEM_HH
#include <dune/foamgrid/foamgrid.hh>
#include <dumux/common/boundarytypes.hh>
#include <dumux/common/parameters.hh>
#include <dumux/common/properties.hh>
#include <dumux/discretization/cctpfa.hh>
#include <dumux/discretization/box.hh>
#include <dumux/porousmediumflow/1p/model.hh>
#include <dumux/porousmediumflow/problem.hh>
#include <dumux/porousmediumflow/1p/incompressiblelocalresidual.hh>
#include <dumux/material/components/constant.hh>
#include <dumux/material/fluidsystems/1pliquid.hh>
#include <dumux/multidomain/embedded/couplingmanager1d3d.hh> // for coupling mode
#include "spatialparams_bloodflow.hh"
namespace Dumux {
// forward declaration
template <class TypeTag> class BloodFlowProblem;
namespace Properties {
// Create new type tags
namespace TTag {
struct BloodFlow { using InheritsFrom = std::tuple<OneP>; };
struct BloodFlowCC { using InheritsFrom = std::tuple<BloodFlow, CCTpfaModel>; };
struct BloodFlowBox { using InheritsFrom = std::tuple<BloodFlow, BoxModel>; };
} // end namespace TTag
// Set the grid type
template<class TypeTag>
struct Grid<TypeTag, TTag::BloodFlow> { using type = Dune::FoamGrid<1, 3>; };
template<class TypeTag>
struct EnableGridGeometryCache<TypeTag, TTag::BloodFlow> { static constexpr bool value = true; };
template<class TypeTag>
struct EnableGridVolumeVariablesCache<TypeTag, TTag::BloodFlow> { static constexpr bool value = true; };
template<class TypeTag>
struct EnableGridFluxVariablesCache<TypeTag, TTag::BloodFlow> { static constexpr bool value = true; };
template<class TypeTag>
struct SolutionDependentAdvection<TypeTag, TTag::BloodFlow> { static constexpr bool value = false; };
template<class TypeTag>
struct SolutionDependentMolecularDiffusion<TypeTag, TTag::BloodFlow> { static constexpr bool value = false; };
template<class TypeTag>
struct SolutionDependentHeatConduction<TypeTag, TTag::BloodFlow> { static constexpr bool value = false; };
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::BloodFlow> { using type = BloodFlowProblem<TypeTag>; };
// the fluid system
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::BloodFlow>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >;
};
// Set the problem property
template<class TypeTag>
struct LocalResidual<TypeTag, TTag::BloodFlow> { using type = OnePIncompressibleLocalResidual<TypeTag>; };
// Set the spatial parameters
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::BloodFlow>
{
using type = BloodFlowSpatialParams<GetPropType<TypeTag, Properties::GridGeometry>,
GetPropType<TypeTag, Properties::Scalar>>;
};
} // end namespace Properties
/*!
* \ingroup EmbeddedTests
......
......@@ -26,8 +26,6 @@
#ifndef DUMUX_TISSUE_PROBLEM_HH
#define DUMUX_TISSUE_PROBLEM_HH
#include <dune/grid/yaspgrid.hh>
#include <dune/geometry/quadraturerules.hh>
#include <dune/localfunctions/lagrange/pqkfactory.hh>
......@@ -35,77 +33,13 @@
#include <dumux/common/math.hh>
#include <dumux/common/parameters.hh>
#include <dumux/common/properties.hh>
#include <dumux/discretization/box.hh>
#include <dumux/discretization/cctpfa.hh>
#include <dumux/porousmediumflow/1p/model.hh>
#include <dumux/porousmediumflow/problem.hh>
#include <dumux/porousmediumflow/1p/incompressiblelocalresidual.hh>
#include <dumux/material/components/constant.hh>
#include <dumux/material/fluidsystems/1pliquid.hh>
#include <dumux/multidomain/embedded/couplingmanager1d3d.hh> // for coupling mode
#include "spatialparams_tissue.hh"
namespace Dumux {
template <class TypeTag>
class TissueProblem;
namespace Properties {
// Create new type tags
namespace TTag {
struct Tissue { using InheritsFrom = std::tuple<OneP>; };
struct TissueCC { using InheritsFrom = std::tuple<Tissue, CCTpfaModel>; };
struct TissueBox { using InheritsFrom = std::tuple<Tissue, BoxModel>; };
} // end namespace TTag
// Set the grid type
template<class TypeTag>
struct Grid<TypeTag, TTag::Tissue> { using type = Dune::YaspGrid<3, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 3> >; };