Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bvpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
MOSAIC
bvpy
Commits
d8d762e9
Commit
d8d762e9
authored
1 month ago
by
PETIT Manuel
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/hotfix/gbvp-write-solution' into develop
parents
e6d2e3e3
58190b82
No related branches found
No related tags found
No related merge requests found
Pipeline
#1104604
passed with warnings
1 month ago
Stage: build
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/bvpy/gbvp.py
+14
-8
14 additions, 8 deletions
src/bvpy/gbvp.py
test/test_gbvp.py
+1
-1
1 addition, 1 deletion
test/test_gbvp.py
with
15 additions
and
9 deletions
src/bvpy/gbvp.py
+
14
−
8
View file @
d8d762e9
...
@@ -114,9 +114,12 @@ class GBVP(BVP):
...
@@ -114,9 +114,12 @@ class GBVP(BVP):
self
.
set_time
(
tmin
)
self
.
set_time
(
tmin
)
self
.
growth_scheme
.
dt
=
dt
self
.
growth_scheme
.
dt
=
dt
current_solution
=
self
.
solution
.
copy
(
deepcopy
=
True
)
current_growth
=
self
.
growth_scheme
.
get_growth
().
copy
(
deepcopy
=
True
)
if
store_steps
:
if
store_steps
:
self
.
solution_steps
[
self
.
time
.
current
]
=
self
.
solution
.
copy
(
deepcopy
=
True
)
self
.
solution_steps
[
self
.
time
.
current
]
=
current_solution
self
.
growth_steps
[
self
.
time
.
current
]
=
self
.
growth_scheme
.
ge
t_growth
()
self
.
growth_steps
[
self
.
time
.
current
]
=
curren
t_growth
if
filename
is
not
None
:
if
filename
is
not
None
:
with
fe
.
HDF5File
(
MPI_COMM_WORLD
,
filename
,
'
w
'
)
as
file
:
with
fe
.
HDF5File
(
MPI_COMM_WORLD
,
filename
,
'
w
'
)
as
file
:
...
@@ -124,8 +127,8 @@ class GBVP(BVP):
...
@@ -124,8 +127,8 @@ class GBVP(BVP):
#file.write(self.domain.cdata, "cell_labels")
#file.write(self.domain.cdata, "cell_labels")
#file.write(self.domain.bdata, "boundary_labels")
#file.write(self.domain.bdata, "boundary_labels")
file
.
write
(
self
.
solution
,
f
'
solution_t
{
self
.
time
.
current
}
'
)
file
.
write
(
current_
solution
,
f
'
solution_t
{
self
.
time
.
current
}
'
)
file
.
write
(
self
.
growth_steps
[
self
.
time
.
current
]
,
f
'
growth_t
{
self
.
time
.
current
}
'
)
file
.
write
(
current_growth
,
f
'
growth_t
{
self
.
time
.
current
}
'
)
# Add parameters related to the domain : sub_domain / sub_boundary
# Add parameters related to the domain : sub_domain / sub_boundary
# if MPI_COMM_WORLD.rank == 0: # h5py does not support parallal mode, use only the main process
# if MPI_COMM_WORLD.rank == 0: # h5py does not support parallal mode, use only the main process
...
@@ -146,14 +149,17 @@ class GBVP(BVP):
...
@@ -146,14 +149,17 @@ class GBVP(BVP):
while
tmax
-
self
.
time
.
current
>=
dt
:
while
tmax
-
self
.
time
.
current
>=
dt
:
self
.
step
(
dt
,
**
kwargs
)
self
.
step
(
dt
,
**
kwargs
)
current_solution
=
self
.
solution
.
copy
(
deepcopy
=
True
)
current_growth
=
self
.
growth_scheme
.
get_growth
().
copy
(
deepcopy
=
True
)
if
store_steps
:
if
store_steps
:
self
.
solution_steps
[
self
.
time
.
current
]
=
self
.
solution
.
copy
(
deepcopy
=
True
)
self
.
solution_steps
[
self
.
time
.
current
]
=
current_solution
self
.
growth_steps
[
self
.
time
.
current
]
=
self
.
growth_scheme
.
get_growth
().
copy
(
deepcopy
=
True
)
self
.
growth_steps
[
self
.
time
.
current
]
=
current_growth
if
filename
is
not
None
:
if
filename
is
not
None
:
with
fe
.
HDF5File
(
MPI_COMM_WORLD
,
filename
,
'
a
'
)
as
file
:
with
fe
.
HDF5File
(
MPI_COMM_WORLD
,
filename
,
'
a
'
)
as
file
:
file
.
write
(
self
.
solution
,
f
'
solution_t
{
self
.
time
.
current
}
'
)
file
.
write
(
current_
solution
,
f
'
solution_t
{
self
.
time
.
current
}
'
)
file
.
write
(
self
.
growth_steps
[
self
.
time
.
current
]
,
f
'
growth_t
{
self
.
time
.
current
}
'
)
file
.
write
(
current_growth
,
f
'
growth_t
{
self
.
time
.
current
}
'
)
self
.
_progressbar
.
update
(
self
.
time
.
current
)
self
.
_progressbar
.
update
(
self
.
time
.
current
)
self
.
_progressbar
.
show
()
self
.
_progressbar
.
show
()
...
...
This diff is collapsed.
Click to expand it.
test/test_gbvp.py
+
1
−
1
View file @
d8d762e9
...
@@ -35,7 +35,7 @@ class TestGBVP(unittest.TestCase):
...
@@ -35,7 +35,7 @@ class TestGBVP(unittest.TestCase):
def
test_run_with_file
(
self
):
def
test_run_with_file
(
self
):
gbvp
=
GBVP
(
self
.
domain
,
self
.
vform
,
self
.
bc
,
growth_scheme
=
self
.
growth_scheme
)
gbvp
=
GBVP
(
self
.
domain
,
self
.
vform
,
self
.
bc
,
growth_scheme
=
self
.
growth_scheme
)
gbvp
.
info
()
gbvp
.
info
()
gbvp
.
run
(
0
,
0.4
,
0.2
,
filename
=
self
.
dir
.
name
+
'
/solution.
xdmf
'
,
linear_solver
=
'
mumps
'
)
gbvp
.
run
(
0
,
0.4
,
0.2
,
filename
=
self
.
dir
.
name
+
'
/solution.
h5
'
,
linear_solver
=
'
mumps
'
)
def
test_run_without_file
(
self
):
def
test_run_without_file
(
self
):
ibvp
=
GBVP
(
self
.
domain
,
self
.
vform
,
self
.
bc
,
growth_scheme
=
self
.
growth_scheme
)
ibvp
=
GBVP
(
self
.
domain
,
self
.
vform
,
self
.
bc
,
growth_scheme
=
self
.
growth_scheme
)
...
...
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