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
0065e694
Commit
0065e694
authored
Aug 28, 2019
by
Simon Scholz
Committed by
Bernd Flemisch
Oct 08, 2019
Browse files
deprecate FVGridGeometry property and use GridGeometry
parent
44c7e062
Changes
7
Hide whitespace changes
Inline
Side-by-side
dumux/assembly/fvassembler.hh
View file @
0065e694
...
...
@@ -56,7 +56,7 @@ class FVAssembler
using
TimeLoop
=
TimeLoopBase
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
;
using
SolutionVector
=
GetPropType
<
TypeTag
,
Properties
::
SolutionVector
>
;
static
constexpr
DiscretizationMethod
discMethod
=
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>::
discMethod
;
static
constexpr
DiscretizationMethod
discMethod
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>::
discMethod
;
static
constexpr
bool
isBox
=
discMethod
==
DiscretizationMethod
::
box
;
using
ThisType
=
FVAssembler
<
TypeTag
,
diffMethod
,
isImplicit
>
;
...
...
@@ -66,7 +66,8 @@ class FVAssembler
public:
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
using
JacobianMatrix
=
GetPropType
<
TypeTag
,
Properties
::
JacobianMatrix
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
GridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
using
FVGridGeometry
[[
deprecated
(
"Use more general GridGeometry instead. FVGridGeometry will be removed after 3.1!"
)]]
=
GridGeometry
;
using
Problem
=
GetPropType
<
TypeTag
,
Properties
::
Problem
>
;
using
GridVariables
=
GetPropType
<
TypeTag
,
Properties
::
GridVariables
>
;
...
...
@@ -78,10 +79,10 @@ public:
* it is however guaranteed that the state after assembly will be the same as before
*/
FVAssembler
(
std
::
shared_ptr
<
const
Problem
>
problem
,
std
::
shared_ptr
<
const
FV
GridGeometry
>
fvG
ridGeometry
,
std
::
shared_ptr
<
const
GridGeometry
>
g
ridGeometry
,
std
::
shared_ptr
<
GridVariables
>
gridVariables
)
:
problem_
(
problem
)
,
fvG
ridGeometry_
(
fvG
ridGeometry
)
,
g
ridGeometry_
(
g
ridGeometry
)
,
gridVariables_
(
gridVariables
)
,
timeLoop_
()
,
isStationaryProblem_
(
true
)
...
...
@@ -111,12 +112,12 @@ public:
* it is however guaranteed that the state after assembly will be the same as before
*/
FVAssembler
(
std
::
shared_ptr
<
const
Problem
>
problem
,
std
::
shared_ptr
<
const
FV
GridGeometry
>
fvG
ridGeometry
,
std
::
shared_ptr
<
const
GridGeometry
>
g
ridGeometry
,
std
::
shared_ptr
<
GridVariables
>
gridVariables
,
std
::
shared_ptr
<
const
TimeLoop
>
timeLoop
,
const
SolutionVector
&
prevSol
)
:
problem_
(
problem
)
,
fvG
ridGeometry_
(
fvG
ridGeometry
)
,
g
ridGeometry_
(
g
ridGeometry
)
,
gridVariables_
(
gridVariables
)
,
timeLoop_
(
timeLoop
)
,
prevSol_
(
&
prevSol
)
...
...
@@ -140,7 +141,7 @@ public:
localAssembler
.
assembleJacobianAndResidual
(
*
jacobian_
,
*
residual_
,
*
gridVariables_
,
partialReassembler
);
});
enforcePeriodicConstraints_
(
*
jacobian_
,
*
residual_
,
*
fvG
ridGeometry_
);
enforcePeriodicConstraints_
(
*
jacobian_
,
*
residual_
,
*
g
ridGeometry_
);
}
/*!
...
...
@@ -189,9 +190,9 @@ public:
// for box communicate the residual with the neighboring processes
if
(
isBox
&&
gridView
().
comm
().
size
()
>
1
)
{
using
VertexMapper
=
typename
FV
GridGeometry
::
VertexMapper
;
using
VertexMapper
=
typename
GridGeometry
::
VertexMapper
;
VertexHandleSum
<
typename
SolutionVector
::
block_type
,
SolutionVector
,
VertexMapper
>
sumResidualHandle
(
residual
,
fvG
ridGeometry_
->
vertexMapper
());
sumResidualHandle
(
residual
,
g
ridGeometry_
->
vertexMapper
());
gridView
().
communicate
(
sumResidualHandle
,
Dune
::
InteriorBorder_InteriorBorder_Interface
,
Dune
::
ForwardCommunication
);
...
...
@@ -251,7 +252,7 @@ public:
jacobian_
->
setSize
(
numDofs
,
numDofs
);
// create occupation pattern of the jacobian
const
auto
occupationPattern
=
getJacobianPattern
<
isImplicit
>
(
fvG
ridGeometry
());
const
auto
occupationPattern
=
getJacobianPattern
<
isImplicit
>
(
g
ridGeometry
());
// export pattern to jacobian
occupationPattern
.
exportIdx
(
*
jacobian_
);
...
...
@@ -263,19 +264,24 @@ public:
//! Returns the number of degrees of freedom
std
::
size_t
numDofs
()
const
{
return
fvG
ridGeometry_
->
numDofs
();
}
{
return
g
ridGeometry_
->
numDofs
();
}
//! The problem
const
Problem
&
problem
()
const
{
return
*
problem_
;
}
//! The global finite volume geometry
const
FVGridGeometry
&
fvGridGeometry
()
const
{
return
*
fvGridGeometry_
;
}
[[
deprecated
(
"Use more general GridGeometry instead. FVGridGeometry will be removed after 3.1!"
)]]
const
GridGeometry
&
fvGridGeometry
()
const
{
return
gridGeometry
();
}
//! The global finite volume geometry
const
GridGeometry
&
gridGeometry
()
const
{
return
*
gridGeometry_
;
}
//! The gridview
const
GridView
&
gridView
()
const
{
return
fvG
ridGeometry
().
gridView
();
}
{
return
g
ridGeometry
().
gridView
();
}
//! The global grid variables
GridVariables
&
gridVariables
()
...
...
@@ -416,9 +422,9 @@ private:
}
template
<
class
GG
>
std
::
enable_if_t
<
GG
::
discMethod
==
DiscretizationMethod
::
box
,
void
>
enforcePeriodicConstraints_
(
JacobianMatrix
&
jac
,
SolutionVector
&
res
,
const
GG
&
fvG
ridGeometry
)
enforcePeriodicConstraints_
(
JacobianMatrix
&
jac
,
SolutionVector
&
res
,
const
GG
&
g
ridGeometry
)
{
for
(
const
auto
&
m
:
fvG
ridGeometry
.
periodicVertexMap
())
for
(
const
auto
&
m
:
g
ridGeometry
.
periodicVertexMap
())
{
if
(
m
.
first
<
m
.
second
)
{
...
...
@@ -436,13 +442,13 @@ private:
}
template
<
class
GG
>
std
::
enable_if_t
<
GG
::
discMethod
!=
DiscretizationMethod
::
box
,
void
>
enforcePeriodicConstraints_
(
JacobianMatrix
&
jac
,
SolutionVector
&
res
,
const
GG
&
fvG
ridGeometry
)
{}
enforcePeriodicConstraints_
(
JacobianMatrix
&
jac
,
SolutionVector
&
res
,
const
GG
&
g
ridGeometry
)
{}
//! pointer to the problem to be solved
std
::
shared_ptr
<
const
Problem
>
problem_
;
//! the finite volume geometry of the grid
std
::
shared_ptr
<
const
FV
GridGeometry
>
fvG
ridGeometry_
;
std
::
shared_ptr
<
const
GridGeometry
>
g
ridGeometry_
;
//! the variables container for the grid
std
::
shared_ptr
<
GridVariables
>
gridVariables_
;
...
...
dumux/assembly/staggeredfvassembler.hh
View file @
0065e694
...
...
@@ -65,16 +65,17 @@ class StaggeredFVAssembler: public MultiDomainFVAssembler<StaggeredMultiDomainTr
using
TimeLoop
=
TimeLoopBase
<
GetPropType
<
TypeTag
,
Properties
::
Scalar
>>
;
public:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
GridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
using
FVGridGeometry
[[
deprecated
(
"Use more general GridGeometry instead. FVGridGeometry will be removed after 3.1!"
)]]
=
GridGeometry
;
using
GridVariables
=
GetPropType
<
TypeTag
,
Properties
::
GridVariables
>
;
using
CouplingManager
=
typename
ParentType
::
CouplingManager
;
//! The constructor for stationary problems
StaggeredFVAssembler
(
std
::
shared_ptr
<
const
Problem
>
problem
,
std
::
shared_ptr
<
const
FV
GridGeometry
>
fvG
ridGeometry
,
std
::
shared_ptr
<
const
GridGeometry
>
g
ridGeometry
,
std
::
shared_ptr
<
GridVariables
>
gridVariables
)
:
ParentType
(
std
::
make_tuple
(
problem
,
problem
),
std
::
make_tuple
(
fvG
ridGeometry
->
cellCenterFVGridGeometryPtr
(),
fvG
ridGeometry
->
faceFVGridGeometryPtr
()),
std
::
make_tuple
(
g
ridGeometry
->
cellCenterFVGridGeometryPtr
(),
g
ridGeometry
->
faceFVGridGeometryPtr
()),
std
::
make_tuple
(
gridVariables
->
cellCenterGridVariablesPtr
(),
gridVariables
->
faceGridVariablesPtr
()),
std
::
make_shared
<
CouplingManager
>
())
{
...
...
@@ -85,11 +86,11 @@ public:
//! The constructor for instationary problems
[[
deprecated
(
"Please use the constructor additionally taking the previous solution. Will be removed after 3.2 release!"
)]]
StaggeredFVAssembler
(
std
::
shared_ptr
<
const
Problem
>
problem
,
std
::
shared_ptr
<
const
FV
GridGeometry
>
fvG
ridGeometry
,
std
::
shared_ptr
<
const
GridGeometry
>
g
ridGeometry
,
std
::
shared_ptr
<
GridVariables
>
gridVariables
,
std
::
shared_ptr
<
const
TimeLoop
>
timeLoop
)
:
ParentType
(
std
::
make_tuple
(
problem
,
problem
),
std
::
make_tuple
(
fvG
ridGeometry
->
cellCenterFVGridGeometryPtr
(),
fvG
ridGeometry
->
faceFVGridGeometryPtr
()),
std
::
make_tuple
(
g
ridGeometry
->
cellCenterFVGridGeometryPtr
(),
g
ridGeometry
->
faceFVGridGeometryPtr
()),
std
::
make_tuple
(
gridVariables
->
cellCenterGridVariablesPtr
(),
gridVariables
->
faceGridVariablesPtr
()),
std
::
make_shared
<
CouplingManager
>
(),
timeLoop
)
...
...
@@ -123,8 +124,12 @@ public:
{
return
ParentType
::
gridVariables
(
Dune
::
index_constant
<
0
>
());
}
//! The global finite volume geometry
const
FVGridGeometry
&
fvGridGeometry
()
const
{
return
ParentType
::
fvGridGeometry
(
Dune
::
index_constant
<
0
>
()).
actualfvGridGeometry
();
}
[[
deprecated
(
"Use more general GridGeometry instead. FVGridGeometry will be removed after 3.1!"
)]]
const
GridGeometry
&
fvGridGeometry
()
const
{
return
gridGeometry
();
}
const
GridGeometry
&
gridGeometry
()
const
{
return
ParentType
::
gridGeometry
(
Dune
::
index_constant
<
0
>
()).
actualfvGridGeometry
();
}
};
...
...
dumux/common/fvproblem.hh
View file @
0065e694
...
...
@@ -580,7 +580,12 @@ public:
// \}
//! The finite volume grid geometry
[[
deprecated
(
"Use more general GridGeometry instead. FVGridGeometry will be removed after 3.1!"
)]]
const
FVGridGeometry
&
fvGridGeometry
()
const
{
return
gridGeometry
();
}
//! The finite volume grid geometry
const
FVGridGeometry
&
gridGeometry
()
const
{
return
*
fvGridGeometry_
;
}
//! The parameter group in which to retrieve runtime parameters
...
...
dumux/common/properties.hh
View file @
0065e694
...
...
@@ -111,8 +111,12 @@ struct BalanceEqOpts { using type = UndefinedProperty; }; //!< A class
template
<
class
TypeTag
,
class
MyTypeTag
>
struct
ElementBoundaryTypes
{
using
type
=
UndefinedProperty
;
};
//!< Stores the boundary types on an element
// TODO: Remove deprecated property FVGridGeometry after 3.1
template
<
class
TypeTag
,
class
MyTypeTag
>
struct
FVGridGeometry
{
using
type
=
UndefinedProperty
;
};
//!< The type of the global finite volume geometry
template
<
class
TypeTag
,
class
MyTypeTag
>
struct
GridGeometry
{
using
type
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
};
//!< The type of the global finite volume geometry
template
<
class
TypeTag
,
class
MyTypeTag
>
struct
EnableFVGridGeometryCache
{
using
type
=
UndefinedProperty
;
};
//!< specifies if geometric data is saved (faster, but more memory consuming)
...
...
dumux/multidomain/fvassembler.hh
View file @
0065e694
...
...
@@ -73,7 +73,10 @@ public:
using
GridVariables
=
typename
MDTraits
::
template
SubDomain
<
id
>
::
GridVariables
;
template
<
std
::
size_t
id
>
using
FVGridGeometry
=
typename
MDTraits
::
template
SubDomain
<
id
>
::
FVGridGeometry
;
using
GridGeometry
=
typename
MDTraits
::
template
SubDomain
<
id
>
::
GridGeometry
;
template
<
std
::
size_t
id
>
using
FVGridGeometry
[[
deprecated
(
"Use more general GridGeometry instead. FVGridGeometry will be removed after 3.1!"
)]]
=
GridGeometry
<
id
>
;
template
<
std
::
size_t
id
>
using
Problem
=
typename
MDTraits
::
template
SubDomain
<
id
>
::
Problem
;
...
...
@@ -357,13 +360,19 @@ public:
//! the finite volume grid geometry of domain i
template
<
std
::
size_t
i
>
[[
deprecated
(
"Use more general GridGeometry instead. FVGridGeometry will be removed after 3.1!"
)]]
const
auto
&
fvGridGeometry
(
Dune
::
index_constant
<
i
>
domainId
)
const
{
return
gridGeometry
(
domainId
);
}
//! the finite volume grid geometry of domain i
template
<
std
::
size_t
i
>
const
auto
&
gridGeometry
(
Dune
::
index_constant
<
i
>
domainId
)
const
{
return
*
std
::
get
<
domainId
>
(
fvGridGeometryTuple_
);
}
//! the grid view of domain i
template
<
std
::
size_t
i
>
const
auto
&
gridView
(
Dune
::
index_constant
<
i
>
domainId
)
const
{
return
fvG
ridGeometry
(
domainId
).
gridView
();
}
{
return
g
ridGeometry
(
domainId
).
gridView
();
}
//! the grid variables of domain i
template
<
std
::
size_t
i
>
...
...
@@ -500,7 +509,7 @@ private:
Dune
::
MatrixIndexSet
getJacobianPattern_
(
Dune
::
index_constant
<
i
>
domainI
,
Dune
::
index_constant
<
j
>
domainJ
)
const
{
const
auto
&
gg
=
fvG
ridGeometry
(
domainI
);
const
auto
&
gg
=
g
ridGeometry
(
domainI
);
auto
pattern
=
getJacobianPattern
<
isImplicit
()
>
(
gg
);
couplingManager_
->
extendJacobianPattern
(
domainI
,
pattern
);
return
pattern
;
...
...
@@ -512,8 +521,8 @@ private:
Dune
::
index_constant
<
j
>
domainJ
)
const
{
return
getCouplingJacobianPattern
<
isImplicit
()
>
(
*
couplingManager_
,
domainI
,
fvG
ridGeometry
(
domainI
),
domainJ
,
fvG
ridGeometry
(
domainJ
));
domainI
,
g
ridGeometry
(
domainI
),
domainJ
,
g
ridGeometry
(
domainJ
));
}
//! pointer to the problem to be solved
...
...
dumux/multidomain/staggeredtraits.hh
View file @
0065e694
...
...
@@ -194,7 +194,8 @@ public:
using
Index
=
Dune
::
index_constant
<
id
>
;
using
TypeTag
=
SubDomainTypeTag
<
id
>
;
using
Problem
=
GetPropType
<
SubDomainTypeTag
<
id
>
,
Properties
::
Problem
>
;
using
FVGridGeometry
=
typename
Detail
::
Staggered
::
SubDomainFVGridGeometryImpl
<
SubDomainTypeTag
,
id
>::
type
;
using
GridGeometry
=
typename
Detail
::
Staggered
::
SubDomainFVGridGeometryImpl
<
SubDomainTypeTag
,
id
>::
type
;
using
FVGridGeometry
[[
deprecated
(
"Use more general GridGeometry instead. FVGridGeometry will be removed after 3.1!"
)]]
=
GridGeometry
;
using
GridVariables
=
typename
Detail
::
Staggered
::
SubDomainGridVariablesImpl
<
SubDomainTypeTag
,
id
>::
type
;
using
SolutionVector
=
typename
Detail
::
Staggered
::
SubDomainSolutionVectorImpl
<
SubDomainTypeTag
,
id
>::
type
;
using
PrimaryVariables
=
typename
Detail
::
Staggered
::
SubDomainPrimaryVariablesImpl
<
SubDomainTypeTag
,
id
>::
type
;
...
...
dumux/multidomain/traits.hh
View file @
0065e694
...
...
@@ -181,7 +181,8 @@ public:
using
Index
=
Dune
::
index_constant
<
id
>
;
using
TypeTag
=
SubDomainTypeTag
<
id
>
;
using
Grid
=
GetPropType
<
SubDomainTypeTag
<
id
>
,
Properties
::
Grid
>
;
using
FVGridGeometry
=
GetPropType
<
SubDomainTypeTag
<
id
>
,
Properties
::
FVGridGeometry
>
;
using
GridGeometry
=
GetPropType
<
SubDomainTypeTag
<
id
>
,
Properties
::
GridGeometry
>
;
using
FVGridGeometry
[[
deprecated
(
"Use more general GridGeometry instead. FVGridGeometry will be removed after 3.1!"
)]]
=
GridGeometry
;
using
Problem
=
GetPropType
<
SubDomainTypeTag
<
id
>
,
Properties
::
Problem
>
;
using
GridVariables
=
GetPropType
<
SubDomainTypeTag
<
id
>
,
Properties
::
GridVariables
>
;
using
IOFields
=
GetPropType
<
SubDomainTypeTag
<
id
>
,
Properties
::
IOFields
>
;
...
...
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