Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dorie
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
31
Issues
31
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
Operations
Operations
Incidents
Environments
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
dorie
dorie
Commits
b4f7935e
Commit
b4f7935e
authored
May 06, 2019
by
Lukas Riedel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define all possible variables const in FV local operator
Const all the things!
parent
5179a67e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
32 deletions
+28
-32
dune/dorie/model/richards/local_operator_FV.hh
dune/dorie/model/richards/local_operator_FV.hh
+28
-32
No files found.
dune/dorie/model/richards/local_operator_FV.hh
View file @
b4f7935e
#ifndef DUNE_DORIE_RICHARDS_OPERATOR_FV_HH
#define DUNE_DORIE_RICHARDS_OPERATOR_FV_HH
#include <vector>
#include <dune/geometry/referenceelements.hh>
#include <dune/pdelab/common/quadraturerules.hh>
...
...
@@ -114,19 +112,19 @@ public:
const
auto
&
entity_o
=
ig
.
outside
();
// Get geometries
auto
geo_f
=
entity_f
.
geometry
();
auto
geo_i
=
entity_i
.
geometry
();
auto
geo_o
=
entity_o
.
geometry
();
const
auto
geo_f
=
entity_f
.
geometry
();
const
auto
geo_i
=
entity_i
.
geometry
();
const
auto
geo_o
=
entity_o
.
geometry
();
// Get volume of entities
const
auto
volume_f
=
geo_f
.
volume
();
// Get normal
auto
normal_f
=
entity_f
.
centerUnitOuterNormal
();
const
auto
normal_f
=
entity_f
.
centerUnitOuterNormal
();
// Entity centers in global coordinates
auto
center_position_i_g
=
geo_i
.
center
();
auto
center_position_o_g
=
geo_o
.
center
();
const
auto
center_position_i_g
=
geo_i
.
center
();
const
auto
center_position_o_g
=
geo_o
.
center
();
// Inside/outside solute value
const
RangeU
u_i
=
x_i
(
lfsu_i
,
0
);
...
...
@@ -150,8 +148,8 @@ public:
+
1.0
/
(
cond_o
+
1E-30
)
);
// Distance between the two entity centers
c
enter_position_i_g
-=
center_position_o_g
;
auto
distance
=
center_position_i_g
.
two_norm
();
c
onst
auto
center_position_diff
=
center_position_i_g
-
center_position_o_g
;
const
auto
distance
=
center_position_diff
.
two_norm
();
// Finite difference of u between the two entities
RangeU
dudn
=
(
u_o
-
u_i
)
/
distance
;
...
...
@@ -210,9 +208,17 @@ public:
const
auto
&
entity_i
=
ig
.
inside
();
// Get geometries
auto
geo_f
=
entity_f
.
geometry
();
const
auto
geo_f
=
entity_f
.
geometry
();
const
auto
&
ref_el_f
=
referenceElement
(
geo_f
);
const
auto
&
center_position_f
=
ref_el_f
.
position
(
0
,
0
);
// Face volume for integration
const
auto
volume_f
=
geo_f
.
volume
();
// Normal vector of intersection
const
auto
normal_f
=
ig
.
centerUnitOuterNormal
();
// Retrieve boundary condition
auto
bc
=
_boundary
->
bc
(
entity_f
,
center_position_f
,
_time
);
// bind parameterization and retrieve functions
...
...
@@ -222,27 +228,21 @@ public:
if
(
BoundaryCondition
::
isDirichlet
(
bc
))
{
auto
geo_i
=
entity_i
.
geometry
();
auto
center_position_i_g
=
geo_i
.
center
();
// Get normal
auto
normal_f
=
entity_f
.
centerUnitOuterNormal
();
const
auto
geo_i
=
entity_i
.
geometry
();
const
auto
center_position_i_g
=
geo_i
.
center
();
// Face center in global coordinates
auto
center_position_f_g
=
geo_f
.
center
();
const
auto
center_position_f_g
=
geo_f
.
center
();
// Compute distance of these two points
c
enter_position_i_g
-=
center_position_f_g
;
auto
distance
=
center_position_i_g
.
two_norm
();
c
onst
auto
position_diff
=
center_position_i_g
-
center_position_f_g
;
const
auto
distance
=
position_diff
.
two_norm
();
// Evaluate Dirichlet condition
auto
g
=
_boundary
->
g
(
entity_f
,
center_position_f
,
_time
);
// Face volume for integration
auto
volume_f
=
geo_f
.
volume
();
const
auto
g
=
_boundary
->
g
(
entity_f
,
center_position_f
,
_time
);
// Inside unknown value
RangeU
u_i
=
x_i
(
lfsu_i
,
0
);
const
RangeU
u_i
=
x_i
(
lfsu_i
,
0
);
// Compute the conductivity
const
RangeU
cond_i
=
conductivity_f_i
(
saturation_f_i
(
u_i
));
...
...
@@ -254,21 +254,18 @@ public:
dudn
-=
_param
->
gravity
()
*
normal_f
;
// Water flux in normal direction w.r.t the intersection
auto
water_flux_n
=
-
cond_i
*
dudn
;
const
auto
water_flux_n
=
-
cond_i
*
dudn
;
// Contribution to residual from Dirichlet boundary
r_i
.
accumulate
(
lfsv_i
,
0
,
water_flux_n
*
volume_f
);
}
else
if
(
BoundaryCondition
::
isNeumann
(
bc
))
{
// Face volume for integration
auto
volume_f
=
geo_f
.
volume
();
// Contribution to residual from Neumann boundary
RangeFieldU
water_flux_f
=
_boundary
->
j
(
entity_f
,
center_position_f
,
_time
);
// Convert water flux into units of matric head flux
water_flux_f
*=
std
::
abs
(
ig
.
centerUnitOuterNormal
()
*
_param
->
gravity
()
);
water_flux_f
*=
std
::
abs
(
normal_f
*
_param
->
gravity
()
);
// water_flux_f *= _param->gravity().two_norm();
r_i
.
accumulate
(
lfsv_i
,
0
,
water_flux_f
*
volume_f
);
...
...
@@ -362,11 +359,10 @@ public:
Traits
::
LocalBasisType
::
Traits
;
// Get range for trial space
using
RangeU
=
typename
LocalBasisTraitsU
::
RangeType
;
RangeU
u
=
x
(
lfsu
,
0
);
const
RangeU
u
=
x
(
lfsu
,
0
);
// entity geometry
auto
geo
=
eg
.
geometry
();
const
auto
geo
=
eg
.
geometry
();
// bind parameterization and retrieve functions
_param
->
bind
(
eg
.
entity
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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