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
00ee4e9f
Commit
00ee4e9f
authored
11 years ago
by
Jean-Matthieu Etancelin
Browse files
Options
Downloads
Patches
Plain Diff
Fix analytic operator requirements. Separate old GL-rendering problem form default problem
parent
095bff6d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
HySoP/hysop/operator/analytic.py
+1
-1
1 addition, 1 deletion
HySoP/hysop/operator/analytic.py
HySoP/hysop/problem/problem.py
+13
-28
13 additions, 28 deletions
HySoP/hysop/problem/problem.py
HySoP/hysop/problem/problem_with_GLRendering.py
+66
-0
66 additions, 0 deletions
HySoP/hysop/problem/problem_with_GLRendering.py
with
80 additions
and
29 deletions
HySoP/hysop/operator/analytic.py
+
1
−
1
View file @
00ee4e9f
...
@@ -80,7 +80,7 @@ class Analytic(Operator):
...
@@ -80,7 +80,7 @@ class Analytic(Operator):
"
Missing simulation value for computation.
"
"
Missing simulation value for computation.
"
# Calling for requirements completion
# Calling for requirements completion
for
red
in
self
.
_
requirement
:
for
red
in
self
.
requirement
s
:
red
.
wait
()
red
.
wait
()
for
v
in
self
.
variables
:
for
v
in
self
.
variables
:
...
...
This diff is collapsed.
Click to expand it.
HySoP/hysop/problem/problem.py
+
13
−
28
View file @
00ee4e9f
...
@@ -21,9 +21,6 @@ class Problem(object):
...
@@ -21,9 +21,6 @@ class Problem(object):
To solve the problem, a loop over time-steps is launched. A step consists
To solve the problem, a loop over time-steps is launched. A step consists
in calling the apply method of each operators and monitors.
\n
in calling the apply method of each operators and monitors.
\n
To finish, a finalize method is called.
\
To finish, a finalize method is called.
\
\r
emark: In case of GPU real-time rendering (i.e. use of an
OpenGLRendering object), The loop over time-steps is passed to Qt4
"""
"""
@debug
@debug
...
@@ -124,13 +121,6 @@ class Problem(object):
...
@@ -124,13 +121,6 @@ class Problem(object):
if
__VERBOSE__
and
main_rank
==
0
:
if
__VERBOSE__
and
main_rank
==
0
:
print
"
====
"
print
"
====
"
for
op
in
self
.
operators
:
try
:
if
op
.
isGLRender
:
self
.
glRenderer
=
op
op
.
setMainLoop
(
self
)
except
AttributeError
:
pass
def
pre_setUp
(
self
):
def
pre_setUp
(
self
):
"""
"""
...
@@ -186,24 +176,19 @@ class Problem(object):
...
@@ -186,24 +176,19 @@ class Problem(object):
"""
"""
if
main_rank
==
0
:
if
main_rank
==
0
:
print
"
\n\n
Start solving ...
"
print
"
\n\n
Start solving ...
"
try
:
while
not
self
.
simulation
.
isOver
:
## Pass the main loop to the OpenGL viewer
self
.
simulation
.
printState
()
if
not
self
.
glRenderer
is
None
:
self
.
glRenderer
.
startMainLoop
()
for
op
in
self
.
operators
:
except
AttributeError
:
if
__VERBOSE__
:
while
not
self
.
simulation
.
isOver
:
print
main_rank
,
op
.
__class__
.
__name__
self
.
simulation
.
printState
()
op
.
apply
(
self
.
simulation
)
for
op
in
self
.
operators
:
testdump
=
\
if
__VERBOSE__
:
self
.
simulation
.
currentIteration
%
self
.
dumpFreq
is
0
print
main_rank
,
op
.
__class__
.
__name__
self
.
simulation
.
advance
()
op
.
apply
(
self
.
simulation
)
if
self
.
_doDump
and
testdump
:
self
.
dump
()
testdump
=
\
self
.
simulation
.
currentIteration
%
self
.
dumpFreq
is
0
self
.
simulation
.
advance
()
if
self
.
_doDump
and
testdump
:
self
.
dump
()
@debug
@debug
def
finalize
(
self
):
def
finalize
(
self
):
...
...
This diff is collapsed.
Click to expand it.
HySoP/hysop/problem/problem_with_GLRendering.py
0 → 100644
+
66
−
0
View file @
00ee4e9f
"""
@file problem_with_GLRendering.py
Extends Problem description to handel real time rendering wit OpenGL.
"""
from
parmepy.constants
import
debug
from
parmepy.tools.timers
import
timed_function
from
parmepy.mpi
import
main_rank
from
parmepy.problem.problem
import
Problem
class
ProblemGLRender
(
Problem
):
"""
For the GPU real-time rendering (i.e. use of an
OpenGLRendering object), The loop over time-steps is passed to Qt4
"""
@debug
def
__init__
(
self
,
operators
,
simulation
,
monitors
=
None
,
dumpFreq
=
100
,
name
=
None
):
"""
Create a transport problem instance.
@param operators : list of operators.
@param simulation : a parmepy.simulation.Simulation object
to describe simulation parameters.
@param monitors : list of monitors.
@param name : an id for the problem
@param dumpFreq : frequency of dump (i.e. saving to a file)
for the problem; set dumpFreq = -1 for no dumps. Default = 100.
"""
Problem
.
__init__
(
self
,
operators
,
simulation
,
monitors
=
monitors
,
dumpFreq
=
dumpFreq
,
name
=
name
)
self
.
gl_renderer
=
None
@debug
@timed_function
def
setUp
(
self
):
"""
Prepare operators (create topologies, allocate memories ...)
"""
Problem
.
setUp
(
self
)
for
ope
in
self
.
operators
:
try
:
if
ope
.
isGLRender
:
self
.
gl_renderer
=
ope
ope
.
setMainLoop
(
self
)
except
AttributeError
:
pass
@debug
@timed_function
def
solve
(
self
):
"""
Solve problem.
Performs simulations iterations by calling each
operators of the list until timer ends.
\n
At end of time step, call an io step.
\n
Displays timings at simulation end.
"""
if
main_rank
==
0
:
print
"
\n\n
Start solving ...
"
self
.
gl_renderer
.
startMainLoop
()
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