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
3ed76500
Commit
3ed76500
authored
8 years ago
by
Dennis Gläser
Committed by
Timo Koch
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[mpfao-fps][localscv] use newly introduced localVertexIndex() of scvf and get rid of optional
parent
505e89b1
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/discretization/cellcentered/mpfa/omethodfps/localsubcontrolentities.hh
+11
-59
11 additions, 59 deletions
...n/cellcentered/mpfa/omethodfps/localsubcontrolentities.hh
with
11 additions
and
59 deletions
dumux/discretization/cellcentered/mpfa/omethodfps/localsubcontrolentities.hh
+
11
−
59
View file @
3ed76500
...
...
@@ -24,7 +24,6 @@
#define DUMUX_DISCRETIZATION_CC_MPFA_O_FPS_LOCALSUBCONTROLENTITIES_HH
#include
<dumux/implicit/cellcentered/mpfa/properties.hh>
#include
"mpfafpsgeometryhelper.hh"
namespace
Dumux
...
...
@@ -54,66 +53,19 @@ class CCMpfaOFpsLocalScv
public:
using
Geometry
=
Dune
::
MultiLinearGeometry
<
Scalar
,
dim
,
dimWorld
>
;
// the default constructor
CCMpfaOFpsLocalScv
()
=
default
;
// the constructor
//! The constructor
//! Initialization in the initializer list is desired to not have to use the optional (see scv).
//! Here, we use the first scvf in the seed to extract an scvf and the local vertex index it is connected to.
//! We know that in the fps scheme all the scvfs are connected to the same vertex. The MpfaFpsGeometry Helper
//! is then used to extract the corners of the given scv (in the geometry constructor).
CCMpfaOFpsLocalScv
(
const
Problem
&
problem
,
const
Element
&
element
,
const
FVElementGeometry
&
fvGeometry
,
const
LocalScvSeed
&
scvSeed
)
:
seedPtr_
(
&
scvSeed
)
{
// the geometry helper that will give us the scv corners
GeometryHelper
geomHelper
(
element
.
geometry
());
// extract the vertex index from the first scvf
auto
vIdxGlobal
=
fvGeometry
.
scvf
(
scvSeed
.
globalScvfIndices
()[
0
]).
vertexIndex
();
// find local index of the vertex in the element
int
vIdxLocal
=
-
1
;
for
(
unsigned
int
localIdx
=
0
;
localIdx
<
element
.
subEntities
(
dim
);
++
localIdx
)
{
if
(
problem
.
vertexMapper
().
subIndex
(
element
,
localIdx
,
dim
)
==
vIdxGlobal
)
{
vIdxLocal
=
localIdx
;
break
;
}
}
assert
(
vIdxLocal
!=
-
1
&&
"could not find the local index of the scv in the element!"
);
// construct the geometry of the scv
geometry_
=
Geometry
(
Dune
::
GeometryType
(
Dune
::
GeometryType
::
cube
,
dim
),
geomHelper
.
getScvCorners
(
vIdxLocal
));
}
//! The copy constrcutor
CCMpfaOFpsLocalScv
(
const
CCMpfaOFpsLocalScv
&
other
)
=
default
;
//! The move constrcutor
CCMpfaOFpsLocalScv
(
CCMpfaOFpsLocalScv
&&
other
)
=
default
;
//! The copy assignment operator
CCMpfaOFpsLocalScv
&
operator
=
(
const
CCMpfaOFpsLocalScv
&
other
)
{
// We want to use the default copy/move assignment.
// But since geometry is not copy assignable :( we
// have to construct it again
geometry_
.
release
();
geometry_
.
emplace
(
other
.
geometry_
.
value
());
return
*
this
;
}
//! The move assignment operator
CCMpfaOFpsLocalScv
&
operator
=
(
CCMpfaOFpsLocalScv
&&
other
)
{
// We want to use the default copy/move assignment.
// But since geometry is not copy assignable :( we
// have to construct it again
geometry_
.
release
();
geometry_
.
emplace
(
other
.
geometry_
.
value
());
return
*
this
;
}
:
seedPtr_
(
&
scvSeed
),
geometry_
(
Dune
::
GeometryType
(
Dune
::
GeometryType
::
cube
,
dim
),
GeometryHelper
(
element
.
geometry
()).
getScvCorners
(
fvGeometry
.
scvf
(
scvSeed
.
globalScvfIndices
()[
0
]).
vertexIndexInElement
()))
{}
GlobalIndexType
globalIndex
()
const
{
return
scvSeed_
().
globalIndex
();
}
...
...
@@ -136,14 +88,14 @@ public:
{
return
geometry
().
corner
(
0
);
}
const
Geometry
&
geometry
()
const
{
return
geometry_
.
value
()
;
}
{
return
geometry_
;
}
private
:
const
LocalScvSeed
&
scvSeed_
()
const
{
return
*
seedPtr_
;
}
const
LocalScvSeed
*
seedPtr_
;
Optional
<
Geometry
>
geometry_
;
Geometry
geometry_
;
};
}
// end namespace
...
...
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