Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
1a215ba7
Commit
1a215ba7
authored
6 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[disc] Export more types from gridvariables
parent
62004ce6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!892
[pm][ff] Improve indices, move into model traits, [pm] free volume variables from type tag
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dumux/discretization/fvgridvariables.hh
+22
-3
22 additions, 3 deletions
dumux/discretization/fvgridvariables.hh
dumux/porousmediumflow/nonequilibrium/gridvariables.hh
+4
-5
4 additions, 5 deletions
dumux/porousmediumflow/nonequilibrium/gridvariables.hh
with
26 additions
and
8 deletions
dumux/discretization/fvgridvariables.hh
+
22
−
3
View file @
1a215ba7
...
...
@@ -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
<
FV
GridGeometry
>
fvGridGeometry
)
std
::
shared_ptr
<
GridGeometry
>
fvGridGeometry
)
:
fvGridGeometry_
(
fvGridGeometry
)
,
curGridVolVars_
(
*
problem
)
,
prevGridVolVars_
(
*
problem
)
...
...
@@ -130,7 +149,7 @@ public:
protected
:
std
::
shared_ptr
<
const
FV
GridGeometry
>
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)
...
...
This diff is collapsed.
Click to expand it.
dumux/porousmediumflow/nonequilibrium/gridvariables.hh
+
4
−
5
View file @
1a215ba7
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment