Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dune-fem-dg
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
Service Desk
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
dune-fem
dune-fem-dg
Commits
c672a840
Commit
c672a840
authored
2 years ago
by
Robert K
Browse files
Options
Downloads
Patches
Plain Diff
[cleanup][FVOperator] Check for cartesian and avoid volume computation.
parent
ed7422da
No related branches found
No related tags found
1 merge request
!48
[feature][FVOperator] A specialized FV operator for finite volume.
Pipeline
#59960
passed
2 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/fem-dg/operator/fluxes/euler/eulerflux_impl.hh
+7
-7
7 additions, 7 deletions
dune/fem-dg/operator/fluxes/euler/eulerflux_impl.hh
dune/fem-dg/operator/fv/fvoperator.hh
+8
-6
8 additions, 6 deletions
dune/fem-dg/operator/fv/fvoperator.hh
with
15 additions
and
13 deletions
dune/fem-dg/operator/fluxes/euler/eulerflux_impl.hh
+
7
−
7
View file @
c672a840
...
...
@@ -430,16 +430,16 @@ namespace EulerNumFlux
static
void
rotate
(
const
FieldType
n
[
dim
],
const
FieldType
u
[
dim
],
FieldType
u_rot
[
dim
])
{
if
(
dim
==
1
)
if
constexpr
(
dim
==
1
)
{
u_rot
[
0
]
=
n
[
0
]
*
u
[
0
];
}
else
if
(
dim
==
2
)
else
if
constexpr
(
dim
==
2
)
{
u_rot
[
0
]
=
n
[
0
]
*
u
[
0
]
+
n
[
1
]
*
u
[
1
];
u_rot
[
1
]
=
-
n
[
1
]
*
u
[
0
]
+
n
[
0
]
*
u
[
1
];
}
else
if
(
dim
==
3
)
else
if
constexpr
(
dim
==
3
)
{
FieldType
d
=
std
::
sqrt
(
n
[
0
]
*
n
[
0
]
+
n
[
1
]
*
n
[
1
]);
...
...
@@ -461,16 +461,16 @@ namespace EulerNumFlux
static
void
rotate_inv
(
const
FieldType
n
[
dim
],
const
FieldType
u_rot
[
dim
],
FieldType
u
[
dim
])
{
if
(
dim
==
1
){
if
constexpr
(
dim
==
1
){
u
[
0
]
=
n
[
0
]
*
u_rot
[
0
];
}
if
(
dim
==
2
){
if
constexpr
(
dim
==
2
){
u
[
0
]
=
n
[
0
]
*
u_rot
[
0
]
-
n
[
1
]
*
u_rot
[
1
];
u
[
1
]
=
n
[
1
]
*
u_rot
[
0
]
+
n
[
0
]
*
u_rot
[
1
];
}
if
(
dim
==
3
){
if
constexpr
(
dim
==
3
){
FieldType
d
=
std
::
sqrt
(
n
[
0
]
*
n
[
0
]
+
n
[
1
]
*
n
[
1
]);
if
(
d
>
1.0e-8
)
{
...
...
@@ -488,7 +488,7 @@ namespace EulerNumFlux
//assert(0); // test it, not tested up to now
}
if
(
dim
>
3
)
assert
(
0
);
if
constexpr
(
dim
>
3
)
assert
(
0
);
}
};
...
...
This diff is collapsed.
Click to expand it.
dune/fem-dg/operator/fv/fvoperator.hh
+
8
−
6
View file @
c672a840
...
...
@@ -7,6 +7,7 @@
#include
<dune/grid/common/geometry.hh>
#include
<dune/fem/gridpart/common/capabilities.hh>
#include
<dune/fem/misc/threads/threaditerator.hh>
#include
<dune/grid/common/gridenums.hh>
...
...
@@ -60,6 +61,8 @@ namespace detail
static
const
int
dimworld
=
GridPartType
::
dimensionworld
;
static
const
int
dimRange
=
Model
::
dimRange
;
typedef
typename
Grid
::
ctype
ctype
;
static
const
bool
isCartesian
=
Fem
::
GridPartCapabilities
::
isCartesian
<
GridPartType
>::
v
;
// only apply the scheme to interior elements
static
const
Dune
::
PartitionIteratorType
ptype
=
Dune
::
InteriorBorder_Partition
;
...
...
@@ -257,10 +260,10 @@ namespace detail
static
const
bool
higherOrder
=
value
;
// cell volume
const
doubl
e
enVolume
=
geo
.
volume
();
const
ctyp
e
enVolume
=
geo
.
volume
();
// 1 over cell volume
const
doubl
e
enVolume_1
=
1.0
/
enVolume
;
const
ctyp
e
enVolume_1
=
1.0
/
enVolume
;
RangeType
uLeft
;
RangeType
uRight
;
...
...
@@ -311,13 +314,12 @@ namespace detail
if
(
neighbor
.
partitionType
()
!=
InteriorEntity
||
enIndex
<
nbIndex
)
{
const
double
nbVolume
=
neighbor
.
geometry
().
volume
();
const
ctype
nbVolume
=
(
isCartesian
)
?
enVolume
:
neighbor
.
geometry
().
volume
();
const
ctype
nbVolume_1
=
(
isCartesian
)
?
enVolume_1
:
1.0
/
nbVolume
;
// local context neighbor
LocalEvalIntersectionType
right
(
neighbor
,
intersection
,
faceCenters_
[
intersection
.
indexInOutside
()
],
localFaceCenter_
,
nbVolume
);
// calculate (1 / neighbor volume)
const
double
nbVolume_1
=
1.0
/
nbVolume
;
// evaluate data for higher order
if
constexpr
(
higherOrder
)
{
...
...
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