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
2c4561b5
Commit
2c4561b5
authored
9 years ago
by
Stefan Girke
Browse files
Options
Downloads
Patches
Plain Diff
adjust flux discrete model, still not compiling (advdiff-test)
parent
475ecc9a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/fem-dg/operator/dg/fluxdiscretemodel.hh
+24
-42
24 additions, 42 deletions
dune/fem-dg/operator/dg/fluxdiscretemodel.hh
dune/fem-dg/operator/fluxes/diffusion/averageflux.hh
+4
-2
4 additions, 2 deletions
dune/fem-dg/operator/fluxes/diffusion/averageflux.hh
with
28 additions
and
44 deletions
dune/fem-dg/operator/dg/fluxdiscretemodel.hh
+
24
−
42
View file @
2c4561b5
...
...
@@ -167,7 +167,7 @@ namespace Fem
void
analyticalFlux
(
const
LocalEvaluation
&
local
,
JacobianRangeType
&
f
)
{
model_
.
jacobian
(
local
.
entity
(),
local
.
time
(),
local
.
position
()
,
local
.
values
()[
uVar
],
f
);
model_
.
jacobian
(
local
,
local
.
values
()[
uVar
],
f
);
}
/**
...
...
@@ -178,41 +178,27 @@ namespace Fem
RangeType
&
gLeft
,
JacobianRangeType
&
gDiffLeft
)
const
{
return
boundaryFluxImpl
(
left
.
intersection
(),
left
.
time
(),
left
.
quadrature
(),
left
.
index
(),
left
.
values
()[
uVar
],
gLeft
,
gDiffLeft
);
return
boundaryFluxImpl
(
left
,
left
.
values
()[
uVar
],
gLeft
,
gDiffLeft
);
}
protected
:
template
<
class
QuadratureImp
,
class
UType
>
double
boundaryFluxImpl
(
const
Intersection
&
it
,
double
time
,
const
QuadratureImp
&
faceQuadInner
,
const
int
quadPoint
,
const
UType
&
uLeft
,
RangeType
&
gLeft
,
JacobianRangeType
&
gDiffLeft
)
const
template
<
class
LocalEvaluation
,
class
UType
>
double
boundaryFluxImpl
(
const
LocalEvaluation
&
left
,
const
UType
&
uLeft
,
RangeType
&
gLeft
,
JacobianRangeType
&
gDiffLeft
)
const
{
const
FaceDomainType
&
x
=
faceQuadInner
.
localPosition
(
quadPoint
);
const
FaceDomainType
&
x
=
left
.
localPosition
();
const
DomainType
normal
=
left
.
intersection
().
integrationOuterNormal
(
x
);
UType
uRight
;
if
(
model_
.
hasBoundaryValue
(
it
,
time
,
x
)
)
{
model_
.
boundaryValue
(
it
,
time
,
x
,
uLeft
,
uRight
);
}
if
(
model_
.
hasBoundaryValue
(
left
)
)
model_
.
boundaryValue
(
left
,
uLeft
,
uRight
);
else
{
uRight
=
uLeft
;
}
return
gradientFlux_
.
gradientBoundaryFlux
(
it
,
inside
(),
time
,
faceQuadInner
,
quadPoint
,
uLeft
,
uRight
,
gLeft
,
gDiffLeft
);
return
gradientFlux_
.
gradientBoundaryFlux
(
left
,
uLeft
,
uRight
,
gLeft
,
gDiffLeft
);
}
private
:
...
...
@@ -344,7 +330,7 @@ namespace Fem
if
(
diffusion
)
{
const
double
dtStiff
=
model_
.
stiffSource
(
local
.
entity
(),
local
.
time
(),
local
.
position
()
,
local
.
values
()[
uVar
],
uJac
,
s
);
model_
.
stiffSource
(
local
,
local
.
values
()[
uVar
],
uJac
,
s
);
dtEst
=
(
dtStiff
>
0
)
?
dtStiff
:
dtEst
;
}
...
...
@@ -352,7 +338,7 @@ namespace Fem
{
RangeType
sNonStiff
(
0
);
const
double
dtNon
=
model_
.
nonStiffSource
(
local
.
entity
(),
local
.
time
(),
local
.
position
()
,
local
.
values
()[
uVar
],
uJac
,
sNonStiff
);
model_
.
nonStiffSource
(
local
,
local
.
values
()[
uVar
],
uJac
,
sNonStiff
);
s
+=
sNonStiff
;
...
...
@@ -410,8 +396,7 @@ namespace Fem
{
RangeType
dLeft
,
dRight
;
diffTimeStep
=
diffFlux_
.
numericalFlux
(
left
.
intersection
(),
*
this
,
left
.
time
(),
left
.
quadrature
(),
right
.
quadrature
(),
left
.
index
(),
diffFlux_
.
numericalFlux
(
left
,
left
.
values
()[
uVar
],
right
.
values
()[
uVar
],
left
.
values
()
[
sigmaVar
],
right
.
values
()[
sigmaVar
],
dLeft
,
dRight
,
...
...
@@ -445,20 +430,18 @@ namespace Fem
double
diffTimeStep
=
0.0
;
bool
hasBoundaryValue
=
model_
.
hasBoundaryValue
(
left
);
bool
hasBoundaryValue
=
model_
.
hasBoundaryValue
(
left
);
if
(
diffusion
&&
hasBoundaryValue
)
{
// diffusion boundary flux for Dirichlet boundaries
RangeType
dLeft
(
0
);
diffTimeStep
=
diffFlux_
.
boundaryFlux
(
left
.
intersection
(),
*
this
,
left
.
time
(),
left
.
quadrature
(),
left
.
index
(),
left
.
values
()[
uVar
],
uBnd_
,
// is set during call of BaseType::boundaryFlux
left
.
values
()[
sigmaVar
],
dLeft
,
gDiffLeft
);
diffTimeStep
=
diffFlux_
.
boundaryFlux
(
left
,
left
.
values
()[
uVar
],
uBnd_
,
// is set during call of BaseType::boundaryFlux
left
.
values
()[
sigmaVar
],
dLeft
,
gDiffLeft
);
gLeft
+=
dLeft
;
}
else
if
(
diffusion
)
...
...
@@ -468,8 +451,7 @@ namespace Fem
typedef
typename
DiffusionFluxType
::
GradientRangeType
GradientRangeType
;
Dune
::
Fem
::
FieldMatrixConverter
<
GradientRangeType
,
JacobianRangeType
>
uJac
(
left
.
values
()[
sigmaVar
]
);
model_
.
diffusionBoundaryFlux
(
left
.
intersection
(),
left
.
time
(),
left
.
localPosition
(),
left
.
values
()[
uVar
],
uJac
,
diffBndFlux
);
model_
.
diffusionBoundaryFlux
(
left
,
left
.
values
()[
uVar
],
uJac
,
diffBndFlux
);
gLeft
+=
diffBndFlux
;
}
else
...
...
@@ -498,7 +480,7 @@ namespace Fem
typedef
typename
DiffusionFluxType
::
GradientRangeType
GradientRangeType
;
Dune
::
Fem
::
FieldMatrixConverter
<
GradientRangeType
,
JacobianRangeType
>
uJac
(
local
.
values
()[
sigmaVar
]
);
model_
.
diffusion
(
local
.
entity
(),
local
.
time
(),
local
.
position
()
,
local
.
values
()[
uVar
],
uJac
,
diffmatrix
);
model_
.
diffusion
(
local
,
local
.
values
()[
uVar
],
uJac
,
diffmatrix
);
// ldg case
f
+=
diffmatrix
;
}
...
...
This diff is collapsed.
Click to expand it.
dune/fem-dg/operator/fluxes/diffusion/averageflux.hh
+
4
−
2
View file @
2c4561b5
...
...
@@ -144,6 +144,7 @@ namespace Fem
if
(
thetaLeft
>
0
)
{
//TODO use diffusionTimeStep
diffTimeStep
=
/* central differences (might be suboptimal) */
model_
.
diffusion
(
left
,
uLeft
,
diffmatrix
);
...
...
@@ -204,6 +205,7 @@ namespace Fem
if
(
thetaRight
>
0
)
uVal
.
axpy
(
thetaRight
,
uBnd
);
//TODO use diffusionTimeStep
const
double
diffTimeStep
=
model_
.
diffusion
(
left
,
uVal
,
diffmatrix
);
...
...
@@ -234,8 +236,6 @@ namespace Fem
const
LocalEvaluation
&
right
,
const
RangeType
&
uLeft
,
const
RangeType
&
uRight
,
const
JacobianRangeType
&
jacLeft
,
const
JacobianRangeType
&
jacRight
,
const
GradientRangeType
&
sigmaLeft
,
const
GradientRangeType
&
sigmaRight
,
RangeType
&
gLeft
,
...
...
@@ -309,8 +309,10 @@ namespace Fem
/* Diffusion (Pass 2) */
/****************************/
JacobianRangeType
diffmatrix
;
//TODO use diffusionTimeStep
double
diffTimeStep
=
model_
.
diffusion
(
left
,
uLeft
,
sigmaLeft
,
diffmatrix
);
diffmatrix
.
mv
(
normal
,
gLeft
);
// add penalty term
...
...
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