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
ec4382eb
Commit
ec4382eb
authored
2 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[fcdiamond][assembler] Handle ghosts in local assembler
parent
dd169e13
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3222
[fcdiamond] Add Navier-Stokes momentum model and tests
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/assembly/fcdiamondlocalassembler.hh
+30
-10
30 additions, 10 deletions
dumux/assembly/fcdiamondlocalassembler.hh
with
30 additions
and
10 deletions
dumux/assembly/fcdiamondlocalassembler.hh
+
30
−
10
View file @
ec4382eb
...
@@ -144,8 +144,27 @@ public:
...
@@ -144,8 +144,27 @@ public:
maybeAssembleCouplingBlocks
(
residual
);
maybeAssembleCouplingBlocks
(
residual
);
}
}
else
else
DUNE_THROW
(
Dune
::
NotImplemented
,
"Ghost elements not supported"
);
{
const
auto
numLocalFaces
=
this
->
element
().
subEntities
(
1
);
for
(
int
i
=
0
;
i
<
numLocalFaces
;
++
i
)
{
// do not change the non-ghost vertices
const
auto
face
=
this
->
element
().
template
subEntity
<
1
>(
i
);
if
(
face
.
partitionType
()
==
Dune
::
InteriorEntity
||
face
.
partitionType
()
==
Dune
::
BorderEntity
)
continue
;
// set main diagonal entries for the vertex
const
auto
dofIndex
=
gridGeometry
.
dofMapper
().
index
(
face
);
typedef
typename
JacobianMatrix
::
block_type
BlockType
;
BlockType
&
J
=
jac
[
dofIndex
][
dofIndex
];
for
(
int
j
=
0
;
j
<
BlockType
::
rows
;
++
j
)
J
[
j
][
j
]
=
1.0
;
// set residual for the vertex
res
[
dofIndex
]
=
0
;
}
}
auto
applyDirichlet
=
[
&
]
(
const
auto
&
scvI
,
auto
applyDirichlet
=
[
&
]
(
const
auto
&
scvI
,
const
auto
&
dirichletValues
,
const
auto
&
dirichletValues
,
...
@@ -390,14 +409,14 @@ public:
...
@@ -390,14 +409,14 @@ public:
{
{
// update the volume variables and compute element residual
// update the volume variables and compute element residual
elemSol
[
scv
.
localDofIndex
()][
pvIdx
]
=
priVar
;
elemSol
[
scv
.
localDofIndex
()][
pvIdx
]
=
priVar
;
deflectionHelper
.
deflect
(
elemSol
,
scv
,
this
->
problem
()
);
deflectionHelper
.
deflect
(
elemSol
,
scv
,
problem
);
this
->
asImp_
().
maybeUpdateCouplingContext
(
scv
,
elemSol
,
pvIdx
);
this
->
asImp_
().
maybeUpdateCouplingContext
(
scv
,
elemSol
,
pvIdx
);
return
this
->
evalLocalResidual
();
return
this
->
evalLocalResidual
();
};
};
// derive the residuals numerically
// derive the residuals numerically
static
const
NumericEpsilon
<
Scalar
,
numEq
>
eps_
{
this
->
problem
()
.
paramGroup
()};
static
const
NumericEpsilon
<
Scalar
,
numEq
>
eps_
{
problem
.
paramGroup
()};
static
const
int
numDiffMethod
=
getParamFromGroup
<
int
>
(
this
->
problem
()
.
paramGroup
(),
"Assembly.NumericDifferenceMethod"
);
static
const
int
numDiffMethod
=
getParamFromGroup
<
int
>
(
problem
.
paramGroup
(),
"Assembly.NumericDifferenceMethod"
);
NumericDifferentiation
::
partialDerivative
(
evalResiduals
,
elemSol
[
scv
.
localDofIndex
()][
pvIdx
],
partialDerivs
,
origResiduals
,
NumericDifferentiation
::
partialDerivative
(
evalResiduals
,
elemSol
[
scv
.
localDofIndex
()][
pvIdx
],
partialDerivs
,
origResiduals
,
eps_
(
elemSol
[
scv
.
localDofIndex
()][
pvIdx
],
pvIdx
),
numDiffMethod
);
eps_
(
elemSol
[
scv
.
localDofIndex
()][
pvIdx
],
pvIdx
),
numDiffMethod
);
...
@@ -468,9 +487,10 @@ public:
...
@@ -468,9 +487,10 @@ public:
DUNE_THROW
(
Dune
::
NotImplemented
,
"partial reassembly for explicit time discretization"
);
DUNE_THROW
(
Dune
::
NotImplemented
,
"partial reassembly for explicit time discretization"
);
// get some aliases for convenience
// get some aliases for convenience
const
auto
&
problem
=
this
->
asImp_
().
problem
();
const
auto
&
element
=
this
->
element
();
const
auto
&
element
=
this
->
element
();
const
auto
&
fvGeometry
=
this
->
fvGeometry
();
const
auto
&
fvGeometry
=
this
->
fvGeometry
();
const
auto
&
curSol
=
this
->
curSol
();
const
auto
&
curSol
=
this
->
asImp_
().
curSol
();
auto
&&
curElemVolVars
=
this
->
curElemVolVars
();
auto
&&
curElemVolVars
=
this
->
curElemVolVars
();
// get the vecor of the acutal element residuals
// get the vecor of the acutal element residuals
...
@@ -508,13 +528,13 @@ public:
...
@@ -508,13 +528,13 @@ public:
{
{
// auto partialDerivsTmp = partialDerivs;
// auto partialDerivsTmp = partialDerivs;
elemSol
[
scv
.
localDofIndex
()][
pvIdx
]
=
priVar
;
elemSol
[
scv
.
localDofIndex
()][
pvIdx
]
=
priVar
;
curVolVars
.
update
(
elemSol
,
this
->
problem
()
,
element
,
scv
);
curVolVars
.
update
(
elemSol
,
problem
,
element
,
scv
);
return
this
->
evalLocalStorageResidual
();
return
this
->
evalLocalStorageResidual
();
};
};
// derive the residuals numerically
// derive the residuals numerically
static
const
NumericEpsilon
<
Scalar
,
numEq
>
eps_
{
this
->
problem
()
.
paramGroup
()};
static
const
NumericEpsilon
<
Scalar
,
numEq
>
eps_
{
problem
.
paramGroup
()};
static
const
int
numDiffMethod
=
getParamFromGroup
<
int
>
(
this
->
problem
()
.
paramGroup
(),
"Assembly.NumericDifferenceMethod"
);
static
const
int
numDiffMethod
=
getParamFromGroup
<
int
>
(
problem
.
paramGroup
(),
"Assembly.NumericDifferenceMethod"
);
NumericDifferentiation
::
partialDerivative
(
evalStorage
,
elemSol
[
scv
.
localDofIndex
()][
pvIdx
],
partialDerivs
,
origStorageResiduals
,
NumericDifferentiation
::
partialDerivative
(
evalStorage
,
elemSol
[
scv
.
localDofIndex
()][
pvIdx
],
partialDerivs
,
origStorageResiduals
,
eps_
(
elemSol
[
scv
.
localDofIndex
()][
pvIdx
],
pvIdx
),
numDiffMethod
);
eps_
(
elemSol
[
scv
.
localDofIndex
()][
pvIdx
],
pvIdx
),
numDiffMethod
);
...
@@ -579,7 +599,7 @@ public:
...
@@ -579,7 +599,7 @@ public:
// get some aliases for convenience
// get some aliases for convenience
const
auto
&
element
=
this
->
element
();
const
auto
&
element
=
this
->
element
();
const
auto
&
fvGeometry
=
this
->
fvGeometry
();
const
auto
&
fvGeometry
=
this
->
fvGeometry
();
const
auto
&
problem
=
this
->
problem
();
const
auto
&
problem
=
this
->
asImp_
().
problem
();
const
auto
&
curElemVolVars
=
this
->
curElemVolVars
();
const
auto
&
curElemVolVars
=
this
->
curElemVolVars
();
const
auto
&
elemFluxVarsCache
=
this
->
elemFluxVarsCache
();
const
auto
&
elemFluxVarsCache
=
this
->
elemFluxVarsCache
();
...
@@ -699,7 +719,7 @@ public:
...
@@ -699,7 +719,7 @@ public:
// get some aliases for convenience
// get some aliases for convenience
const
auto
&
element
=
this
->
element
();
const
auto
&
element
=
this
->
element
();
const
auto
&
fvGeometry
=
this
->
fvGeometry
();
const
auto
&
fvGeometry
=
this
->
fvGeometry
();
const
auto
&
problem
=
this
->
problem
();
const
auto
&
problem
=
this
->
asImp_
().
problem
();
const
auto
&
curElemVolVars
=
this
->
curElemVolVars
();
const
auto
&
curElemVolVars
=
this
->
curElemVolVars
();
// get the vector of the actual element residuals
// get the vector of the actual element residuals
...
...
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