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
3c3ae620
Commit
3c3ae620
authored
6 years ago
by
Robert K
Browse files
Options
Downloads
Patches
Plain Diff
[bugfix][_operator] hasFlux is true if either hasAdvection or
hasDiffusion is true.
parent
84e2bda6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!4
Latest features added to dune-fem-dg.
Pipeline
#11388
failed
6 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/dune/femdg/_operators.py
+9
-9
9 additions, 9 deletions
python/dune/femdg/_operators.py
with
9 additions
and
9 deletions
python/dune/femdg/_operators.py
+
9
−
9
View file @
3c3ae620
...
...
@@ -154,8 +154,8 @@ def createFemDGSolver(Model, space,
x
=
SpatialCoordinate
(
space
.
cell
())
t
=
NamedConstant
(
space
,
"
time
"
)
hasFlux
=
hasattr
(
Model
,
"
F_c
"
)
if
hasFlux
:
has
Adv
Flux
=
hasattr
(
Model
,
"
F_c
"
)
if
has
Adv
Flux
:
advModel
=
inner
(
Model
.
F_c
(
t
,
x
,
u
),
grad
(
v
))
*
dx
else
:
advModel
=
inner
(
t
*
grad
(
u
-
u
),
grad
(
v
))
*
dx
# TODO: make a better empty model
...
...
@@ -165,8 +165,8 @@ def createFemDGSolver(Model, space,
else
:
advModel
+=
inner
(
t
*
u
,
v
)
*
dx
hasDiff
usion
=
hasattr
(
Model
,
"
F_v
"
)
if
hasDiff
usion
:
hasDiff
Flux
=
hasattr
(
Model
,
"
F_v
"
)
if
hasDiff
Flux
:
diffModel
=
inner
(
Model
.
F_v
(
t
,
x
,
u
,
grad
(
u
)),
grad
(
v
))
*
dx
else
:
diffModel
=
inner
(
t
*
grad
(
u
-
u
),
grad
(
v
))
*
dx
# TODO: make a better empty model
...
...
@@ -285,10 +285,10 @@ def createFemDGSolver(Model, space,
##################################
## Add 'has*' properties for model
struct
.
append
([
Declaration
(
Variable
(
"
const bool
"
,
"
hasAdvection
"
),
initializer
=
hasFlux
or
hasNonStiffSource
,
Variable
(
"
const bool
"
,
"
hasAdvection
"
),
initializer
=
has
Adv
Flux
or
hasNonStiffSource
,
static
=
True
)])
struct
.
append
([
Declaration
(
Variable
(
"
const bool
"
,
"
hasDiffusion
"
),
initializer
=
hasDiff
usion
,
Variable
(
"
const bool
"
,
"
hasDiffusion
"
),
initializer
=
hasDiff
Flux
,
static
=
True
)])
struct
.
append
([
Declaration
(
Variable
(
"
const bool
"
,
"
hasStiffSource
"
),
initializer
=
hasStiffSource
,
...
...
@@ -297,7 +297,7 @@ def createFemDGSolver(Model, space,
Variable
(
"
const bool
"
,
"
hasNonStiffSource
"
),
initializer
=
hasNonStiffSource
,
static
=
True
)])
struct
.
append
([
Declaration
(
Variable
(
"
const bool
"
,
"
hasFlux
"
),
initializer
=
hasFlux
,
Variable
(
"
const bool
"
,
"
hasFlux
"
),
initializer
=
has
AdvFlux
or
hasDiff
Flux
,
static
=
True
)])
###################################################
...
...
@@ -309,8 +309,8 @@ def createFemDGSolver(Model, space,
advFluxId
=
"
Dune::Fem::AdvectionFlux::Enum::llf
"
diffFluxId
=
"
Dune::Fem::DiffusionFlux::Enum::none
"
if
hasDiff
usion
:
diffFluxId
=
"
Dune::Fem::DiffusionFlux::Enum::
cdg2
"
if
hasDiff
Flux
:
diffFluxId
=
"
Dune::Fem::DiffusionFlux::Enum::
primal
"
if
limiter
==
None
or
limiter
==
False
or
limiter
.
lower
()
==
"
unlimiter
"
:
limiterId
=
"
Dune::Fem::AdvectionLimiter::Enum::unlimited
"
...
...
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