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
eb9d68a5
Commit
eb9d68a5
authored
1 year ago
by
Dennis Gläser
Browse files
Options
Downloads
Patches
Plain Diff
[examples][cahn-hilliard] minor improvements related to code docs
parent
13ff5521
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3661
Cleanup/cahn hilliard example
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/cahn_hilliard/main.cc
+2
-2
2 additions, 2 deletions
examples/cahn_hilliard/main.cc
examples/cahn_hilliard/model.hh
+5
-6
5 additions, 6 deletions
examples/cahn_hilliard/model.hh
with
7 additions
and
8 deletions
examples/cahn_hilliard/main.cc
+
2
−
2
View file @
eb9d68a5
...
@@ -85,7 +85,7 @@ public:
...
@@ -85,7 +85,7 @@ public:
// In the `source` function, we implement the derivative of the free energy.
// In the `source` function, we implement the derivative of the free energy.
// This demonstrates how parts of the local residual can be split into model specific
// This demonstrates how parts of the local residual can be split into model specific
// parts and parts that might change from scenario to scenario.
// parts
(see `CahnHilliardModelLocalResidual`)
and parts that might change from scenario to scenario.
template
<
class
ElementVolumeVariables
>
template
<
class
ElementVolumeVariables
>
NumEqVector
source
(
const
Element
&
element
,
NumEqVector
source
(
const
Element
&
element
,
const
FVElementGeometry
&
fvGeometry
,
const
FVElementGeometry
&
fvGeometry
,
...
@@ -114,7 +114,7 @@ public:
...
@@ -114,7 +114,7 @@ public:
// The parameters interfaces are used in the local residual (see Part 1).
// The parameters interfaces are used in the local residual (see Part 1).
// We can name this interface however we want as long as we adapt the calling site
// We can name this interface however we want as long as we adapt the calling site
// in the `LocalResidual` class in `model.hh`.
// in the `
CahnHilliardModel
LocalResidual` class in `model.hh`.
// [[codeblock]]
// [[codeblock]]
Scalar
mobility
()
const
Scalar
mobility
()
const
{
return
mobility_
;
}
{
return
mobility_
;
}
...
...
This diff is collapsed.
Click to expand it.
examples/cahn_hilliard/model.hh
+
5
−
6
View file @
eb9d68a5
...
@@ -181,14 +181,13 @@ public:
...
@@ -181,14 +181,13 @@ public:
}
}
// [[/codeblock]]
// [[/codeblock]]
// **Flux term:** The function `computeFlux` computes the fluxes
// **Flux term:** The function `computeFlux` computes the integrated
// over a sub control volume faces, including the integration over
// fluxes over a sub control volume face.
// the area of the face.
//
//
// ```math
// ```math
// \begin{aligned}
// \begin{aligned}
// F_{K,\sigma,0} &= -M \sum_{B \in \mathcal{B}_K} \mu_{h,B} \nabla N_B \cdot\boldsymbol{n}
\vert \sigma \vert
\cr
// F_{K,\sigma,0} &= -M
\vert \sigma \vert
\sum_{B \in \mathcal{B}_K} \mu_{h,B} \nabla N_B \cdot\boldsymbol{n} \cr
// F_{K,\sigma,1} &= -\gamma \sum_{B \in \mathcal{B}_K} c_{h,B} \nabla N_B \cdot\boldsymbol{n}
\vert \sigma \vert
// F_{K,\sigma,1} &= -\gamma
\vert \sigma \vert
\sum_{B \in \mathcal{B}_K} c_{h,B} \nabla N_B \cdot\boldsymbol{n}
// \end{aligned}
// \end{aligned}
// ````
// ````
//
//
...
@@ -209,7 +208,7 @@ public:
...
@@ -209,7 +208,7 @@ public:
for
(
const
auto
&
scv
:
scvs
(
fvGeometry
))
for
(
const
auto
&
scv
:
scvs
(
fvGeometry
))
{
{
const
auto
&
volVars
=
elemVolVars
[
scv
];
const
auto
&
volVars
=
elemVolVars
[
scv
];
// v.axpy(a, w) means v
<- v
+ a*w
// v.axpy(a, w) means v +
=
a*w
gradConcentration
.
axpy
(
gradConcentration
.
axpy
(
volVars
.
concentration
(),
volVars
.
concentration
(),
fluxVarCache
.
gradN
(
scv
.
indexInElement
())
fluxVarCache
.
gradN
(
scv
.
indexInElement
())
...
...
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