Skip to content
Snippets Groups Projects
Commit 1a215ba7 authored by Timo Koch's avatar Timo Koch
Browse files

[disc] Export more types from gridvariables

parent 62004ce6
No related branches found
No related tags found
1 merge request!892[pm][ff] Improve indices, move into model traits, [pm] free volume variables from type tag
......@@ -24,6 +24,7 @@
#ifndef DUMUX_FV_GRID_VARIABLES_HH
#define DUMUX_FV_GRID_VARIABLES_HH
#include <type_traits>
#include <memory>
namespace Dumux {
......@@ -35,13 +36,31 @@ namespace Dumux {
* \tparam the type of the grid volume variables
* \tparam the type of the grid flux variables cache
*/
template<class FVGridGeometry, class GridVolumeVariables, class GridFluxVariablesCache>
template<class GG, class GVV, class GFVC>
class FVGridVariables
{
public:
//! export type of the finite volume grid geometry
using GridGeometry = GG;
//! export type of the finite volume grid geometry
using GridVolumeVariables = GVV;
//! export type of the volume variables
using VolumeVariables = typename GridVolumeVariables::VolumeVariables;
//! export primary variable type
using PrimaryVariables = typename VolumeVariables::PrimaryVariables;
//! export scalar type (TODO get it directly from the volvars)
using Scalar = std::decay_t<decltype(std::declval<PrimaryVariables>()[0])>;
//! export type of the finite volume grid geometry
using GridFluxVariablesCache = GFVC;
template<class Problem>
FVGridVariables(std::shared_ptr<Problem> problem,
std::shared_ptr<FVGridGeometry> fvGridGeometry)
std::shared_ptr<GridGeometry> fvGridGeometry)
: fvGridGeometry_(fvGridGeometry)
, curGridVolVars_(*problem)
, prevGridVolVars_(*problem)
......@@ -130,7 +149,7 @@ public:
protected:
std::shared_ptr<const FVGridGeometry> fvGridGeometry_; //!< pointer to the constant grid geometry
std::shared_ptr<const GridGeometry> fvGridGeometry_; //!< pointer to the constant grid geometry
private:
GridVolumeVariables curGridVolVars_; //!< the current volume variables (primary and secondary variables)
......
......@@ -47,7 +47,6 @@ class NonEquilibriumGridVariables
typename GET_PROP_TYPE(TypeTag, GridVolumeVariables),
typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache)>;
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
using GridView = typename FVGridGeometry::GridView;
......@@ -60,16 +59,17 @@ class NonEquilibriumGridVariables
static constexpr bool isBox = FVGridGeometry::discMethod == DiscretizationMethod::box;
public:
//! export the type used for scalar values
using typename ParentType::Scalar;
//! Constructor
NonEquilibriumGridVariables(std::shared_ptr<Problem> problem,
std::shared_ptr<FVGridGeometry> fvGridGeometry)
: ParentType(problem, fvGridGeometry)
, problem_(problem)
{
for (int phaseIdx =0; phaseIdx<numPhases; ++phaseIdx)
{
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
velocityNorm_[phaseIdx].assign(fvGridGeometry->numDofs(), 0.0);
}
}
template<class SolutionVector>
......@@ -95,7 +95,6 @@ public:
auto elemVolVars = localView(this->curGridVolVars());
fvGeometry.bind(element);
elemVolVars.bind(element, fvGeometry, curSol);
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment