Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
69dca450
Commit
69dca450
authored
Apr 05, 2018
by
Sina Ackermann
Browse files
[common] Use NumEqVector for source, rename ResidualVector
parent
0db82058
Changes
2
Hide whitespace changes
Inline
Side-by-side
dumux/common/fvproblem.hh
View file @
69dca450
...
...
@@ -53,7 +53,7 @@ class FVProblem
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
PrimaryVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
PrimaryVariables
);
using
Residual
Vector
=
typename
GET_PROP_TYPE
(
TypeTag
,
NumEqVector
);
using
NumEq
Vector
=
typename
GET_PROP_TYPE
(
TypeTag
,
NumEqVector
);
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
...
...
@@ -248,7 +248,7 @@ public:
* Negative values mean influx.
* E.g. for the mass balance that would the mass flux in \f$ [ kg / (m^2 \cdot s)] \f$.
*/
Residual
Vector
neumann
(
const
Element
&
element
,
NumEq
Vector
neumann
(
const
Element
&
element
,
const
FVElementGeometry
&
fvGeometry
,
const
ElementVolumeVariables
&
elemVolVars
,
const
SubControlVolumeFace
&
scvf
)
const
...
...
@@ -266,11 +266,11 @@ public:
* Negative values mean influx.
* E.g. for the mass balance that would be the mass flux in \f$ [ kg / (m^2 \cdot s)] \f$.
*/
Residual
Vector
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
NumEq
Vector
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
//! As a default, i.e. if the user's problem does not overload any neumann method
//! return no-flow Neumann boundary conditions at all Neumann boundaries
return
Residual
Vector
(
0.0
);
return
NumEq
Vector
(
0.0
);
}
/*!
...
...
@@ -291,7 +291,7 @@ public:
* that the conserved quantity is created, negative ones mean that it vanishes.
* E.g. for the mass balance that would be a mass rate in \f$ [ kg / (m^3 \cdot s)] \f$.
*/
Residual
Vector
source
(
const
Element
&
element
,
NumEq
Vector
source
(
const
Element
&
element
,
const
FVElementGeometry
&
fvGeometry
,
const
ElementVolumeVariables
&
elemVolVars
,
const
SubControlVolume
&
scv
)
const
...
...
@@ -313,11 +313,11 @@ public:
* that the conserved quantity is created, negative ones mean that it vanishes.
* E.g. for the mass balance that would be a mass rate in \f$ [ kg / (m^3 \cdot s)] \f$.
*/
Residual
Vector
sourceAtPos
(
const
GlobalPosition
&
globalPos
)
const
NumEq
Vector
sourceAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
//! As a default, i.e. if the user's problem does not overload any source method
//! return 0.0 (no source terms)
return
Residual
Vector
(
0.0
);
return
NumEq
Vector
(
0.0
);
}
/*!
...
...
@@ -399,12 +399,12 @@ public:
* Caution: Only overload this method in the implementation if you know
* what you are doing.
*/
Residual
Vector
scvPointSources
(
const
Element
&
element
,
NumEq
Vector
scvPointSources
(
const
Element
&
element
,
const
FVElementGeometry
&
fvGeometry
,
const
ElementVolumeVariables
&
elemVolVars
,
const
SubControlVolume
&
scv
)
const
{
Residual
Vector
source
(
0
);
NumEq
Vector
source
(
0
);
auto
scvIdx
=
scv
.
indexInElement
();
auto
key
=
std
::
make_pair
(
fvGridGeometry_
->
elementMapper
().
index
(
element
),
scvIdx
);
if
(
pointSourceMap_
.
count
(
key
))
...
...
dumux/common/pointsource.hh
View file @
69dca450
...
...
@@ -52,7 +52,7 @@ class PointSource
{
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
PrimaryVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
PrimaryVariables
);
using
NumEqVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
NumEqVector
);
using
Problem
=
typename
GET_PROP_TYPE
(
TypeTag
,
Problem
);
using
ElementVolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementVolumeVariables
);
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
LocalView
;
...
...
@@ -64,7 +64,7 @@ class PointSource
public:
//! Constructor for constant point sources
PointSource
(
GlobalPosition
pos
,
PrimaryVariables
values
)
PointSource
(
GlobalPosition
pos
,
NumEqVector
values
)
:
values_
(
values
),
pos_
(
pos
),
embeddings_
(
1
)
{}
//! Constructor for sol dependent point sources, when there is no
...
...
@@ -101,7 +101,7 @@ public:
}
//! Convenience = operator overload modifying only the values
PointSource
&
operator
=
(
const
PrimaryVariables
&
values
)
PointSource
&
operator
=
(
const
NumEqVector
&
values
)
{
values_
=
values
;
return
*
this
;
...
...
@@ -115,7 +115,7 @@ public:
}
//! return the source values
PrimaryVariables
values
()
const
NumEqVector
values
()
const
{
return
values_
;
}
//! return the source position
...
...
@@ -155,7 +155,7 @@ public:
}
protected:
PrimaryVariables
values_
;
//!< value of the point source for each equation
NumEqVector
values_
;
//!< value of the point source for each equation
private:
GlobalPosition
pos_
;
//!< position of the point source
std
::
size_t
embeddings_
;
//!< how many SCVs the point source is associated with
...
...
@@ -171,27 +171,27 @@ class IdPointSource : public PointSource<TypeTag>
using
ParentType
=
PointSource
<
TypeTag
>
;
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
PrimaryVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
PrimaryVariables
);
using
NumEqVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
NumEqVector
);
static
const
int
dimworld
=
GridView
::
dimensionworld
;
using
GlobalPosition
=
Dune
::
FieldVector
<
Scalar
,
dimworld
>
;
public:
//! Constructor for constant point sources
IdPointSource
(
GlobalPosition
pos
,
PrimaryVariables
values
,
IdType
id
)
IdPointSource
(
GlobalPosition
pos
,
NumEqVector
values
,
IdType
id
)
:
ParentType
(
pos
,
values
),
id_
(
id
)
{}
//! Constructor for sol dependent point sources, when there is no
// value known at the time of initialization
IdPointSource
(
GlobalPosition
pos
,
IdType
id
)
:
ParentType
(
pos
,
PrimaryVariables
(
0.0
)),
id_
(
id
)
{}
:
ParentType
(
pos
,
NumEqVector
(
0.0
)),
id_
(
id
)
{}
//! return the sources identifier
IdType
id
()
const
{
return
id_
;
}
//! Convenience = operator overload modifying only the values
IdPointSource
&
operator
=
(
const
PrimaryVariables
&
values
)
IdPointSource
&
operator
=
(
const
NumEqVector
&
values
)
{
ParentType
::
operator
=
(
values
);
return
*
this
;
...
...
@@ -218,7 +218,7 @@ class SolDependentPointSource : public PointSource<TypeTag>
using
ParentType
=
PointSource
<
TypeTag
>
;
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
PrimaryVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
PrimaryVariables
);
using
NumEqVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
NumEqVector
);
using
Problem
=
typename
GET_PROP_TYPE
(
TypeTag
,
Problem
);
using
ElementVolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementVolumeVariables
);
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
LocalView
;
...
...
@@ -227,19 +227,19 @@ class SolDependentPointSource : public PointSource<TypeTag>
static
const
int
dimworld
=
GridView
::
dimensionworld
;
using
GlobalPosition
=
typename
Dune
::
FieldVector
<
Scalar
,
dimworld
>
;
// returns the PointSource values as
PrimaryVariables
using
ValueFunction
=
typename
std
::
function
<
PrimaryVariables
(
const
Problem
&
problem
,
const
Element
&
element
,
const
FVElementGeometry
&
fvGeometry
,
const
ElementVolumeVariables
&
elemVolVars
,
const
SubControlVolume
&
scv
)
>
;
// returns the PointSource values as
NumEqVector
using
ValueFunction
=
typename
std
::
function
<
NumEqVector
(
const
Problem
&
problem
,
const
Element
&
element
,
const
FVElementGeometry
&
fvGeometry
,
const
ElementVolumeVariables
&
elemVolVars
,
const
SubControlVolume
&
scv
)
>
;
public:
//! Constructor for sol dependent point sources, when there is no
// value known at the time of initialization
SolDependentPointSource
(
GlobalPosition
pos
,
ValueFunction
valueFunction
)
:
ParentType
(
pos
,
PrimaryVariables
(
0.0
)),
valueFunction_
(
valueFunction
)
{}
:
ParentType
(
pos
,
NumEqVector
(
0.0
)),
valueFunction_
(
valueFunction
)
{}
//! an update function called before adding the value
// to the local residual in the problem in scvPointSources
...
...
@@ -252,7 +252,7 @@ public:
{
this
->
values_
=
valueFunction_
(
problem
,
element
,
fvGeometry
,
elemVolVars
,
scv
);
}
//! Convenience = operator overload modifying only the values
SolDependentPointSource
&
operator
=
(
const
PrimaryVariables
&
values
)
SolDependentPointSource
&
operator
=
(
const
NumEqVector
&
values
)
{
ParentType
::
operator
=
(
values
);
return
*
this
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment