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
fb2ded7d
Commit
fb2ded7d
authored
7 years ago
by
Dennis Gläser
Browse files
Options
Downloads
Patches
Plain Diff
[evalGradients] fix errors
parent
0b4cb642
No related branches found
No related tags found
1 merge request
!617
[WIP] Next
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/discretization/evalgradients.hh
+13
-10
13 additions, 10 deletions
dumux/discretization/evalgradients.hh
with
13 additions
and
10 deletions
dumux/discretization/evalgradients.hh
+
13
−
10
View file @
fb2ded7d
...
@@ -56,11 +56,14 @@ evalGradients(const Element& element,
...
@@ -56,11 +56,14 @@ evalGradients(const Element& element,
const
typename
Element
::
Geometry
::
GlobalCoordinate
&
globalPos
)
const
typename
Element
::
Geometry
::
GlobalCoordinate
&
globalPos
)
{
{
using
PrimaryVariables
=
typename
BoxElementSolution
<
TypeTag
>::
PrimaryVariables
;
using
PrimaryVariables
=
typename
BoxElementSolution
<
TypeTag
>::
PrimaryVariables
;
using
PriVarGradients
=
Dune
::
FieldVector
<
typename
Element
::
Geometry
::
GlobalCoordinate
,
PrimaryVariables
::
dimension
>
;
using
GlobalPosition
=
typename
Element
::
Geometry
::
GlobalCoordinate
;
// evalu
t
ae gradients using the local finite element basis
// evalua
t
e gradients using the local finite element basis
const
auto
&
localBasis
=
fvGridGeometry
.
feCache
().
get
(
geometry
.
type
()).
localBasis
();
const
auto
&
localBasis
=
fvGridGeometry
.
feCache
().
get
(
geometry
.
type
()).
localBasis
();
// the inverse transposed of the jacobian matrix
const
auto
jacInvT
=
g
.
jacobianInverseTransposed
(
local
);
// evaluate the shape function gradients at the scv center
// evaluate the shape function gradients at the scv center
using
ShapeJacobian
=
typename
decltype
(
localBasis
)
::
Traits
::
JacobianType
;
using
ShapeJacobian
=
typename
decltype
(
localBasis
)
::
Traits
::
JacobianType
;
const
auto
localPos
=
geometry
.
local
(
globalPos
);
const
auto
localPos
=
geometry
.
local
(
globalPos
);
...
@@ -68,15 +71,15 @@ evalGradients(const Element& element,
...
@@ -68,15 +71,15 @@ evalGradients(const Element& element,
localBasis
.
evaluateJacobian
(
localPos
,
shapeJacobian
);
localBasis
.
evaluateJacobian
(
localPos
,
shapeJacobian
);
// interpolate the gradients
// interpolate the gradients
Pri
V
ar
Gra
dien
t
s
result
(
PrimaryVariables
(
0.0
)
);
Dune
::
FieldVector
<
GlobalPosition
,
Pri
m
ar
yVariables
::
di
m
ens
ion
>
result
(
PrimaryVariables
(
0.0
)
);
for
(
int
i
=
0
;
i
<
element
.
subEntities
(
dim
);
++
i
)
for
(
int
i
=
0
;
i
<
element
.
subEntities
(
Element
::
Geometry
::
mydimension
);
++
i
)
{
{
// the global shape function gradient
// the global shape function gradient
GlobalPosition
gradN
;
GlobalPosition
gradN
;
jacInvT
.
mv
(
shapeJacobian
[
i
][
0
],
gradN
);
jacInvT
.
mv
(
shapeJacobian
[
i
][
0
],
gradN
);
// add gradient to global privar gradients
// add gradient to global privar gradients
for
(
unsigned
int
pvIdx
=
0
;
pvIdx
<
numEq
;
++
pvIdx
)
for
(
unsigned
int
pvIdx
=
0
;
pvIdx
<
PrimaryVariables
::
dimension
;
++
pvIdx
)
{
{
GlobalPosition
tmp
(
gradN
);
GlobalPosition
tmp
(
gradN
);
tmp
*=
elemSol
[
i
][
pvIdx
];
tmp
*=
elemSol
[
i
][
pvIdx
];
...
@@ -103,11 +106,11 @@ evalGradients(const Element& element,
...
@@ -103,11 +106,11 @@ evalGradients(const Element& element,
*/
*/
template
<
class
Element
,
class
FVGridGeometry
,
class
TypeTag
>
template
<
class
Element
,
class
FVGridGeometry
,
class
TypeTag
>
typename
CCElementSolution
<
TypeTag
>::
PrimaryVariables
typename
CCElementSolution
<
TypeTag
>::
PrimaryVariables
eval
Solution
(
const
Element
&
element
,
eval
Gradients
(
const
Element
&
element
,
const
typename
Element
::
Geometry
&
geometry
,
const
typename
Element
::
Geometry
&
geometry
,
const
FVGridGeometry
&
fvGridGeometry
,
const
FVGridGeometry
&
fvGridGeometry
,
const
CCElementSolution
<
TypeTag
>&
elemSol
,
const
CCElementSolution
<
TypeTag
>&
elemSol
,
const
typename
Element
::
Geometry
::
GlobalCoordinate
&
globalPos
)
const
typename
Element
::
Geometry
::
GlobalCoordinate
&
globalPos
)
{
DUNE_THROW
(
Dune
::
NotImplemented
,
"General gradient evaluation for cell-centered methods"
);
}
{
DUNE_THROW
(
Dune
::
NotImplemented
,
"General gradient evaluation for cell-centered methods"
);
}
}
// namespace Dumux
}
// namespace Dumux
...
...
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