Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hysop
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
particle_methods
hysop
Commits
c4f1392c
Commit
c4f1392c
authored
11 years ago
by
Jean-Matthieu Etancelin
Browse files
Options
Downloads
Patches
Plain Diff
Add prefix parameter for adaptative timestep
parent
c46488ac
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
HySoP/hysop/operator/adapt_timestep.py
+6
-5
6 additions, 5 deletions
HySoP/hysop/operator/adapt_timestep.py
HySoP/hysop/operator/discrete/adapt_timestep.py
+4
-4
4 additions, 4 deletions
HySoP/hysop/operator/discrete/adapt_timestep.py
with
10 additions
and
9 deletions
HySoP/hysop/operator/adapt_timestep.py
+
6
−
5
View file @
c4f1392c
...
...
@@ -25,12 +25,12 @@ class AdaptTimeStep(Operator):
dt_adapt
=
None
,
method
=
{
TimeIntegrator
:
RK3
,
SpaceDiscretisation
:
FD_C_4
,
dtAdvecCrit
:
'
vort
'
},
topo
=
None
,
ghosts
=
None
,
**
other_config
):
topo
=
None
,
ghosts
=
None
,
prefix
=
'
./dt.dat
'
,
**
other_config
):
"""
Create a timeStep-evaluation operator from given
velocity and vorticity variables.
Note : If cfl is None, the computation of the adaptative time step
Note : If cfl is None, the computation of the adaptative time step
is only based on dt_advection and dt_stretching, taking the minimum
value of the two.
...
...
@@ -39,9 +39,9 @@ class AdaptTimeStep(Operator):
@param resolutions : grid resolution of velocity and vorticity
@param dt_adapt : adaptative timestep variable
@param method : solving method
default = finite differences, 4th order in space for gradU evaluation
default = finite differences, 4th order in space for gradU evaluation
(used in dt_advection computation)
and Runge-Kutta 3 in time (used in dt_stretching computation) and
and Runge-Kutta 3 in time (used in dt_stretching computation) and
criterion for advection time step evaluation.
@param topo : a predefined topology to discretize velocity/vorticity
@param ghosts : number of ghosts points. Default depends on the method.
...
...
@@ -60,6 +60,7 @@ class AdaptTimeStep(Operator):
self
.
dt_adapt
=
dt_adapt
## Numerical methods for time and space discretization
self
.
method
=
method
self
.
prefix
=
prefix
assert
SpaceDiscretisation
in
self
.
method
.
keys
()
assert
TimeIntegrator
in
self
.
method
.
keys
()
if
not
dtAdvecCrit
in
self
.
method
.
keys
():
...
...
@@ -100,7 +101,7 @@ class AdaptTimeStep(Operator):
AdaptTimeStep_D
(
self
.
discreteFields
[
self
.
velocity
],
self
.
discreteFields
[
self
.
vorticity
],
self
.
dt_adapt
,
method
=
self
.
method
,
method
=
self
.
method
,
prefix
=
self
.
prefix
,
**
self
.
config
)
self
.
discreteOperator
.
setUp
()
...
...
This diff is collapsed.
Click to expand it.
HySoP/hysop/operator/discrete/adapt_timestep.py
+
4
−
4
View file @
c4f1392c
...
...
@@ -35,7 +35,7 @@ class AdaptTimeStep_D(DiscreteOperator):
dt_adapt
=
None
,
method
=
{
TimeIntegrator
:
RK3
,
SpaceDiscretisation
:
FD_C_4
,
dtAdvecCrit
:
'
vort
'
},
lcfl
=
0.125
,
cfl
=
0.5
):
lcfl
=
0.125
,
cfl
=
0.5
,
prefix
=
'
./dt.dat
'
):
"""
@param velocity : discrete field
@param vorticity : discrete field
...
...
@@ -77,7 +77,7 @@ class AdaptTimeStep_D(DiscreteOperator):
# Definition of criterion for dt_advec computation
self
.
dtAdvecCrit
=
self
.
method
[
dtAdvecCrit
]
self
.
prefix
=
'
./res/dt_adaptative.dat
'
self
.
prefix
=
prefix
if
(
main_rank
==
0
):
self
.
f
=
open
(
self
.
prefix
,
'
w
'
)
...
...
@@ -88,7 +88,7 @@ class AdaptTimeStep_D(DiscreteOperator):
self
.
velocity
.
nbComponents
)
# gradU function
self
.
_function
=
GradV
(
self
.
velocity
.
topology
,
self
.
_function
=
GradV
(
self
.
velocity
.
topology
,
method
=
self
.
method
[
SpaceDiscretisation
])
memshape
=
self
.
velocity
.
data
[
0
].
shape
worklength
=
self
.
velocity
.
nbComponents
**
2
...
...
@@ -190,7 +190,7 @@ class AdaptTimeStep_D(DiscreteOperator):
self
.
dt_adapt
.
data
[
0
]
=
min
(
dt_advec
,
dt_stretch
,
dt_cfl
)
self
.
dt_adapt
.
data
[
0
]
=
\
self
.
velocity
.
topology
.
topo
.
allreduce
(
self
.
dt_adapt
.
data
[
0
],
self
.
velocity
.
topology
.
topo
.
allreduce
(
self
.
dt_adapt
.
data
[
0
],
PARMES_MPI_REAL
,
op
=
MPI
.
MIN
)
...
...
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