Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-phasefield
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Contributor 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
Lars von Wolff
dune-phasefield
Commits
f07d054c
Commit
f07d054c
authored
3 years ago
by
Baric, Andrej
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
8486c213
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/phasefield/fem_2p_cahnhilliard_a.hh
+89
-0
89 additions, 0 deletions
dune/phasefield/fem_2p_cahnhilliard_a.hh
with
89 additions
and
0 deletions
dune/phasefield/fem_2p_cahnhilliard_a.hh
0 → 100644
+
89
−
0
View file @
f07d054c
#pragma once
#include
<dune/pdelab/common/quadraturerules.hh>
#include
<dune/pdelab/finiteelement/localbasiscache.hh>
#include
<dune/pdelab/localoperator/defaultimp.hh>
#include
<dune/pdelab/localoperator/pattern.hh>
#include
<dune/pdelab/localoperator/flags.hh>
#include
<dune/pdelab/localoperator/variablefactories.hh>
#include
<dune/pdelab/gridfunctionspace/gridfunctionspace.hh>
#include
<dune/phasefield/localoperator/fem_base_chns.hh>
//Parameter class (for functions), FEM space and RangeField
template
<
typename
Param
,
typename
CHGFS
,
typename
CHContainer
>
class
FEM_2P_CahnHilliard_a
:
public
Dune
::
PDELab
::
FullVolumePattern
,
public
Dune
::
PDELab
::
LocalOperatorDefaultFlags
,
public
Dune
::
PDELab
::
NumericalJacobianVolume
<
FEM_2P_CahnHilliard_a
<
Param
,
CHGFS
,
CHContainer
>
>
,
public
Dune
::
PDELab
::
NumericalJacobianApplyVolume
<
FEM_2P_CahnHilliard_a
<
Param
,
CHGFS
,
CHContainer
>
>
{
private:
typedef
typename
CHContainer
::
field_type
RF
;
typedef
typename
CHGFS
::
Traits
::
GridViewType
::
template
Codim
<
0
>
::
Entity
ENTITY
;
CHLocalBasisCache
<
CHGFS
>
chCache
;
typedef
GFS_LocalViewer
<
CHGFS
,
CHContainer
,
ENTITY
,
RF
>
CHLView
;
mutable
CHLView
chOldLocal
;
Param
&
param
;
// parameter functions
public:
enum
{
doPatternVolume
=
true
};
enum
{
doAlphaVolume
=
true
};
//constructor
FEM_2P_CahnHilliard_a
(
Param
&
param_
,
CHGFS
&
chGfs_
,
CHContainer
&
chVOld_
)
:
chOldLocal
(
chGfs_
,
chVOld_
),
param
(
param_
)
{
}
template
<
typename
EG
,
typename
LFSU
,
typename
X
,
typename
LFSV
,
typename
R
>
void
alpha_volume
(
const
EG
&
eg
,
const
LFSU
&
lfsu
,
const
X
&
x
,
const
LFSV
&
lfsv
,
R
&
r
)
const
{
//Quadrature Rule
const
int
dim
=
EG
::
Entity
::
dimension
;
const
int
order
=
5
;
auto
rule
=
Dune
::
PDELab
::
quadratureRule
(
eg
.
geometry
(),
order
);
chOldLocal
.
DoEvaluation
(
eg
);
for
(
const
auto
&
ip
:
rule
)
{
const
auto
S
=
eg
.
geometry
().
jacobianInverseTransposed
(
ip
.
position
());
auto
factor
=
ip
.
weight
()
*
eg
.
geometry
().
integrationElement
(
ip
.
position
());
CHVariables_PFOld_Extension
<
RF
,
dim
,
LFSV
>
ch
(
chCache
,
ip
.
position
(),
lfsv
,
x
.
base
(),
chOldLocal
.
lv
,
S
);
for
(
size_t
i
=
0
;
i
<
ch
.
pfspace
.
size
();
i
++
)
{
RF
J1
=
param
.
mobility
.
eval
(
ch
.
pf
)
*
(
ch
.
gradxi
*
ch
.
basis
.
gradphi
[
i
][
0
]);
const
float
alpha
=
50
;
// integrate: (pf-pfold)*phi_i/delta_t + gradpf * grad phi_i + ...
//weak form CH pf=c, xi=z, phi=testfkt
r
.
accumulate
(
ch
.
pfspace
,
i
,
factor
*
(
(
ch
.
pf
-
ch
.
pfOld
)
*
ch
.
basis
.
phi
[
i
]
/
param
.
time
.
dt
+
1
/
param
.
eps
*
param
.
dw
.
eval_dd
(
ch
.
pf
)
*
(
ch
.
gadpf
*
ch
.
basis
.
gradphi
[
i
][
0
])
-
alpha
*
(
ch
.
gradxi
*
ch
.
basis
.
gradphi
[
i
][
0
]
)
+
alpha
*
(
ch
.
gradpf
*
ch
.
basis
.
gradphi
[
i
][
0
])
));
//weak from laplace z
r
.
accumulate
(
ch
.
xispace
,
i
,
factor
*
(
ch
.
gradxi
*
ch
.
basis
.
gradphi
[
i
][
0
]
+
alpha
(
ch
.
xi
*
ch
.
basis
.
phi
[
i
]
)
-
alpha
(
ch
.
pf
*
ch
.
basis
.
phi
[
i
]
)
));
}
}
}
};
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