Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dg
dg
Commits
792dba47
Commit
792dba47
authored
Oct 19, 2016
by
Jonathan Lambrechts
Browse files
rewrite readMsh and rename to readIdx
parent
e2e4b25f
Pipeline
#1172
passed with stage
in 27 minutes and 33 seconds
Changes
63
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
benchmarks/Atmosphere/jablonowski/jablonowski.py
View file @
792dba47
...
...
@@ -422,7 +422,7 @@ for i in range(0,nbSteps):
if
(
i
==
nbStart
and
i
>
0
):
loadFile
=
exportBaseDir
+
'/'
+
loadDirName
+
'/solution/solution-0'
+
str
(
nbStart
)
+
'.idx'
print
(
'Reloading solution '
,
loadFile
)
solution
.
readMsh
(
loadFile
)
solution
.
importIdx
(
loadFile
)
# if (i%10000==0 and i > nbStart):
# print ('Writing solution for reload')
# solutionExporter.exportIdx(i, t)
...
...
benchmarks/Atmosphere/periodic_convection_3d/periodic_convection_imexrk4.py
View file @
792dba47
...
...
@@ -42,7 +42,7 @@ groups.splitFaceGroupsByOrientation(extrusion, ["bottom_bottom_surf", "top_botto
claw
=
dgEulerAtmLaw
(
dimension
)
####Load reference solution from file###
reloaded
=
dgDofContainer
(
groups
,
claw
.
getNbFields
())
reloaded
.
readMsh
(
"refSolERK"
+
str
(
period
)
+
"/subwindow3/subwindow3.idx"
)
reloaded
.
importIdx
(
"refSolERK"
+
str
(
period
)
+
"/subwindow3/subwindow3.idx"
)
solution
=
dgDofContainer
(
groups
,
claw
.
getNbFields
())
XYZ
=
groups
.
getFunctionCoordinates
();
...
...
benchmarks/Atmosphere/rising_bubble/rising_bubble_con_test.py
View file @
792dba47
...
...
@@ -56,8 +56,8 @@ groups.splitGroupsByPhysicalTag();
claw
=
dgEulerAtmLaw
(
dimension
)
####Load reference solution from file###
reloaded
=
dgDofContainer
(
groups
,
claw
.
getNbFields
())
#reloaded.
readMsh
("refSolERK/refSolERK.idx")
reloaded
.
readMsh
(
"refSolERK/subwindow8/subwindow8.idx"
)
#reloaded.
importIdx
("refSolERK/refSolERK.idx")
reloaded
.
importIdx
(
"refSolERK/subwindow8/subwindow8.idx"
)
solution
=
dgDofContainer
(
groups
,
claw
.
getNbFields
())
XYZ
=
groups
.
getFunctionCoordinates
();
...
...
@@ -158,7 +158,7 @@ thetap=functionPython(1, getThetap, [solution.getFunction(), XYZ])
####Load initial solution from file###
readInit
=
dgDofContainer
(
groups
,
claw
.
getNbFields
())
readInit
.
readMsh
(
"refSolERK/subwindow6/subwindow6.idx"
)
readInit
.
importIdx
(
"refSolERK/subwindow6/subwindow6.idx"
)
solution
.
copy
(
readInit
)
rhoHs
=
dgDofContainer
(
groups
,
1
)
...
...
benchmarks/GreatBarrierReef/LPT_Caller_DualReefMap.py
View file @
792dba47
...
...
@@ -218,7 +218,7 @@ print 'Smallest element\'s surface is', minSurface, 'msq, Largest element\'s sur
bathDC
=
dgDofContainer
(
groups
,
1
);
if
(
os
.
path
.
exists
(
"./Bath/"
+
simMesh
+
"_bath_smooth/"
+
simMesh
+
"_bath_smooth.idx"
)):
print
(
colored
(
'Importing bathymetry ...'
,
"red"
))
bathDC
.
readMsh
(
"./Bath/"
+
simMesh
+
"_bath_smooth/"
+
simMesh
+
"_bath_smooth.idx"
)
bathDC
.
importIdx
(
"./Bath/"
+
simMesh
+
"_bath_smooth/"
+
simMesh
+
"_bath_smooth.idx"
)
else
:
print
(
colored
(
'**** ERROR: Bathymetry file does not exist! ****'
,
"red"
))
#-------------------------------------------------------------------------------
...
...
@@ -518,7 +518,7 @@ for n in range(1,LP_TotIter+1):
print
'Problem in loadedSolutions!'
else
:
print
'-> simSolution not already loaded. Loading it from file. m is:'
,
m
,
'. File is (gbr-%06d'
%
(
iterNumberWanted
)
+
').'
simSolution
.
readMsh
(
simOutputDir
+
'/mr-gbr/mr-gbr-%06d'
%
(
iterNumberWanted
)
+
'.idx'
)
simSolution
.
importIdx
(
simOutputDir
+
'/mr-gbr/mr-gbr-%06d'
%
(
iterNumberWanted
)
+
'.idx'
)
loadedSolutions
[
0
]
=
iterNumberWanted
else
:
...
...
@@ -545,7 +545,7 @@ for n in range(1,LP_TotIter+1):
else
:
print
'-> simSolutionUnder not already loaded. Loading it from file. l is:'
,
l
,
'. File is (gbr-%06d'
%
(
iterNumberWanted
-
l
)
+
').'
t_solUnder
=
simStartTime
+
float
(
iterNumberWanted
-
l
)
*
simDt
simSolutionUnder
.
readMsh
(
simOutputDir
+
'/mr-gbr/mr-gbr-%06d'
%
(
iterNumberWanted
-
l
)
+
'.idx'
)
simSolutionUnder
.
importIdx
(
simOutputDir
+
'/mr-gbr/mr-gbr-%06d'
%
(
iterNumberWanted
-
l
)
+
'.idx'
)
loadedSolutions
[
2
]
=
iterNumberWanted
-
l
m
=
0
...
...
@@ -570,7 +570,7 @@ for n in range(1,LP_TotIter+1):
else
:
print
'-> simSolutionOver not already loaded. Loading it from file. m is:'
,
m
,
'. File is (gbr-%06d'
%
(
iterNumberWanted
+
m
)
+
').'
t_solOver
=
simStartTime
+
float
(
iterNumberWanted
+
m
)
*
simDt
simSolutionOver
.
readMsh
(
simOutputDir
+
'/mr-gbr/mr-gbr-%06d'
%
(
iterNumberWanted
+
m
)
+
'.idx'
)
simSolutionOver
.
importIdx
(
simOutputDir
+
'/mr-gbr/mr-gbr-%06d'
%
(
iterNumberWanted
+
m
)
+
'.idx'
)
loadedSolutions
[
1
]
=
iterNumberWanted
+
m
scaleFactor
=
1.0
-
(
t
-
t_solUnder
)
/
(
t_solOver
-
t_solUnder
)
...
...
benchmarks/GreatBarrierReef/MultirateGBR.py
View file @
792dba47
...
...
@@ -178,7 +178,7 @@ solution = dgDofContainer(groups, claw.getNbFields())
bathDC
=
dgDofContainer
(
groups
,
1
)
if
(
os
.
path
.
exists
(
"./Bath/"
+
filename
+
"_bath_smooth/"
+
filename
+
"_bath_smooth.idx"
)):
Msg
.
Info
(
"Smoothed bathymetry already exists."
)
bathDC
.
readMsh
(
"./Bath/"
+
filename
+
"_bath_smooth/"
+
filename
+
"_bath_smooth.idx"
)
bathDC
.
importIdx
(
"./Bath/"
+
filename
+
"_bath_smooth/"
+
filename
+
"_bath_smooth.idx"
)
Msg
.
Info
(
"Smoothed bathymetry read."
)
else
:
diffuseBathymetry
(
groups
,
UTMtoLonLatDegrees
,
bathDC
,
filename
)
...
...
@@ -196,7 +196,7 @@ reefsDCfilename = "GBR_Functions/reefsFunction_"+filename+"/reefsFunction_"+file
if
(
os
.
path
.
exists
(
reefsDCfilename
)):
if
(
Msg
.
GetCommRank
()
==
0
):
print
'Reef Map file found: '
+
reefsDCfilename
+
' ; loading this.'
reefsDC
.
readMsh
(
reefsDCfilename
)
reefsDC
.
importIdx
(
reefsDCfilename
)
else
:
if
(
Msg
.
GetCommRank
()
==
0
):
print
'Reef Map file '
+
reefsDCfilename
+
' not found. Loading reef map ...'
...
...
@@ -209,7 +209,7 @@ else:
#3. Delete reefs object data
reefsObj
.
clearReefsData
()
Msg
.
Barrier
()
reefsDC
.
readMsh
(
reefsDCfilename
)
reefsDC
.
importIdx
(
reefsDCfilename
)
# ************************************************
...
...
@@ -463,7 +463,7 @@ else:
# ** OPTIONAL 1/3: Load an existing DC as the initial solution DC
if
(
startFromExistingSolution
==
1
):
solution
.
readMsh
(
solutionFileName
)
solution
.
importIdx
(
solutionFileName
)
# **********************************************
...
...
benchmarks/GreatBarrierReef/MultirateGBR_oldProj.py
View file @
792dba47
...
...
@@ -112,7 +112,7 @@ bathDC = dgDofContainer(groups, 1)
if
(
os
.
path
.
exists
(
"./Bath/"
+
filename
+
"_bath_smooth/"
+
filename
+
"_bath_smooth.idx"
)):
Msg
.
Info
(
"Smoothed bathymetry already exists."
)
bathDC
.
readMsh
(
"./Bath/"
+
filename
+
"_bath_smooth/"
+
filename
+
"_bath_smooth.idx"
)
bathDC
.
importIdx
(
"./Bath/"
+
filename
+
"_bath_smooth/"
+
filename
+
"_bath_smooth.idx"
)
Msg
.
Info
(
"Smoothed bathymetry read."
)
else
:
Msg
.
Fatal
(
"You need to run DiffuseBathGBR_Standalone first!"
)
...
...
@@ -131,7 +131,7 @@ reefsDCfilename = "GBR_Functions/reefsFunction_"+filename+"/reefsFunction_"+file
if
(
os
.
path
.
exists
(
reefsDCfilename
)):
if
(
Msg
.
GetCommRank
()
==
0
):
print
'Reef Map file found: '
+
reefsDCfilename
+
' ; loading this.'
reefsDC
.
readMsh
(
reefsDCfilename
)
reefsDC
.
importIdx
(
reefsDCfilename
)
else
:
if
(
Msg
.
GetCommRank
()
==
0
):
print
'Reef Map file '
+
reefsDCfilename
+
' not found. Loading reef map ...'
...
...
@@ -294,7 +294,7 @@ solution = dgDofContainer(groups, claw.getNbFields())
# ** OPTIONAL 1/3: Load an existing DC as the initial solution DC
if
(
startFromExistingSolution
==
1
):
solution
.
readMsh
(
solutionFileName
)
solution
.
importIdx
(
solutionFileName
)
# **********************************************
...
...
benchmarks/GreatBarrierReef/PartitionGBR.py
View file @
792dba47
...
...
@@ -72,7 +72,7 @@ bathDC = dgDofContainer(groups, 1);
if
(
not
os
.
path
.
exists
(
"./Bath/"
+
filename
+
"_bath_smooth/"
+
filename
+
"_bath_smooth.idx"
)):
Msg
.
Fatal
(
'No valid bathymetry file found, please launch "rundgpy DiffuseBathGBR.py"'
)
Msg
.
Info
(
"Smoothed bathymetry already exists."
)
bathDC
.
readMsh
(
"./Bath/"
+
filename
+
"_bath_smooth/"
+
filename
+
"_bath_smooth.idx"
)
bathDC
.
importIdx
(
"./Bath/"
+
filename
+
"_bath_smooth/"
+
filename
+
"_bath_smooth.idx"
)
Msg
.
Info
(
"Smoothed bathymetry read."
)
# Define Conservation Law
...
...
benchmarks/GreatBarrierReef/PartitionGBR_oldProj.py
View file @
792dba47
...
...
@@ -69,7 +69,7 @@ bathDC = dgDofContainer(groups, 1);
if
(
not
os
.
path
.
exists
(
"./Bath/"
+
filename
+
"_bath_smooth/"
+
filename
+
"_bath_smooth.idx"
)):
Msg
.
Fatal
(
'No valid bathymetry file found, please launch "rundgpy DiffuseBathGBR.py"'
)
Msg
.
Info
(
"Smoothed bathymetry already exists."
)
bathDC
.
readMsh
(
"./Bath/"
+
filename
+
"_bath_smooth/"
+
filename
+
"_bath_smooth.idx"
)
bathDC
.
importIdx
(
"./Bath/"
+
filename
+
"_bath_smooth/"
+
filename
+
"_bath_smooth.idx"
)
Msg
.
Info
(
"Smoothed bathymetry read."
)
# Define Conservation Law
...
...
benchmarks/GreatBarrierReef/SingleRateBenchmark/SinglerateGBR.py
View file @
792dba47
...
...
@@ -87,7 +87,7 @@ bathDC = dgDofContainer(groups, 1)
if
(
os
.
path
.
exists
(
"./Bath/"
+
filename
+
"_bath_smooth/"
+
filename
+
"_bath_smooth.idx"
)):
Msg
.
Info
(
"Smoothed bathymetry already exists."
)
bathDC
.
readMsh
(
"./Bath/"
+
filename
+
"_bath_smooth/"
+
filename
+
"_bath_smooth.idx"
)
bathDC
.
importIdx
(
"./Bath/"
+
filename
+
"_bath_smooth/"
+
filename
+
"_bath_smooth.idx"
)
Msg
.
Info
(
"Smoothed bathymetry read."
)
else
:
Msg
.
Fatal
(
"You need to run DiffuseBathGBR_Standalone first!"
)
...
...
@@ -106,7 +106,7 @@ reefsDCfilename = "GBR_Functions/reefsFunction_"+filename+"/reefsFunction_"+file
if
(
os
.
path
.
exists
(
reefsDCfilename
)):
if
(
Msg
.
GetCommRank
()
==
0
):
print
(
'Reef Map file found: '
+
reefsDCfilename
+
' ; loading this.'
)
reefsDC
.
readMsh
(
reefsDCfilename
)
reefsDC
.
importIdx
(
reefsDCfilename
)
else
:
if
(
Msg
.
GetCommRank
()
==
0
):
print
(
'Reef Map file '
+
reefsDCfilename
+
' not found. Loading reef map ...'
)
...
...
@@ -199,7 +199,7 @@ solution = dgDofContainer(groups, claw.getNbFields())
# ** OPTIONAL 1/3: Load an existing DC as the initial solution DC
if
(
startFromExistingSolution
==
1
):
solution
.
readMsh
(
solutionFileName
)
solution
.
importIdx
(
solutionFileName
)
# **********************************************
...
...
benchmarks/MultiRate/ParallelScaling/GBR/MultirateScalingGBR.py
View file @
792dba47
...
...
@@ -24,7 +24,7 @@ if(not os.path.exists(bathname)):
Msg
.
Fatal
(
'No valid bathymetry file :'
+
bathname
+
' found, please launch "rundgpy DiffuseBathymetryTsunami.py"'
)
bath
=
dgDofContainer
(
groups
,
1
);
bath
.
readMsh
(
bathname
)
bath
.
importIdx
(
bathname
)
def
tide
(
f
):
for
i
in
range
(
0
,
f
.
size1
()):
...
...
benchmarks/MultiRate/ParallelScaling/GBR/PartitionGBR.py
View file @
792dba47
...
...
@@ -19,7 +19,7 @@ bath = dgDofContainer(groups, 1);
if
(
not
os
.
path
.
exists
(
bathname
)):
Msg
.
Fatal
(
'No valid bathymetry file :'
+
bathname
+
' found, please launch "rundgpy DiffuseBathymetryTsunami.py"'
)
bath
.
readMsh
(
bathname
)
bath
.
importIdx
(
bathname
)
# Define Conservation Law
claw
=
dgConservationLawShallowWater2d
()
solution
=
dgDofContainer
(
groups
,
claw
.
getNbFields
())
...
...
benchmarks/MultiRate/ParallelScaling/tsunami/MultirateScalingTsunami.py
View file @
792dba47
...
...
@@ -14,7 +14,7 @@ bath = dgDofContainer(groups, 1);
bathname
=
outputDir
+
"/"
+
filename
+
"_bath_smooth"
+
"/"
+
filename
+
"_bath_smooth.idx"
if
(
os
.
path
.
exists
(
bathname
)):
bath
.
readMsh
(
bathname
)
bath
.
importIdx
(
bathname
)
else
:
Msg
.
Fatal
(
"No corresponding bathymetry file, launch DiffuseBathymetryTsunami.py"
)
...
...
benchmarks/MultiRate/ParallelScaling/tsunami/PartitionTsunami.py
View file @
792dba47
...
...
@@ -14,7 +14,7 @@ bath = dgDofContainer(groups, 1);
bathname
=
outputDir
+
"/"
+
filename
+
"_bath_smooth"
+
"/"
+
filename
+
"_bath_smooth.idx"
if
(
os
.
path
.
exists
(
bathname
)):
bath
.
readMsh
(
bathname
)
bath
.
importIdx
(
bathname
)
else
:
Msg
.
Fatal
(
"No corresponding bathymetry file, launch DiffuseBathymetryTsunami.py"
)
...
...
benchmarks/MultiRate/ParallelScaling/tsunami/SRPartitionTsunami.py
View file @
792dba47
...
...
@@ -15,7 +15,7 @@ bath = dgDofContainer(gr, 1);
if
(
os
.
path
.
exists
(
outputDir
+
"/"
+
filename
+
"_bath_smooth"
+
"/"
+
filename
+
"_bath_smooth.idx"
)):
Msg
.
Info
(
'.... Import Default Smoothed Bathymetry'
)
bath
.
readMsh
(
outputDir
+
"/"
+
filename
+
"_bath_smooth"
+
"/"
+
filename
+
"_bath_smooth.idx"
)
bath
.
importIdx
(
outputDir
+
"/"
+
filename
+
"_bath_smooth"
+
"/"
+
filename
+
"_bath_smooth.idx"
)
else
:
Msg
.
Fatal
(
"No corresponding bathymetry file"
)
claw
=
dgConservationLawShallowWater2d
()
...
...
benchmarks/MultiRate/ParallelScaling/tsunami/SimulationTsunami.py
View file @
792dba47
...
...
@@ -14,7 +14,7 @@ bath = dgDofContainer(groups, 1);
bathname
=
outputDir
+
"/"
+
filename
+
"_bath_smooth"
+
"/"
+
filename
+
"_bath_smooth.idx"
if
(
os
.
path
.
exists
(
bathname
)):
bath
.
readMsh
(
bathname
)
bath
.
importIdx
(
bathname
)
else
:
Msg
.
Fatal
(
"No corresponding bathymetry file, launch DiffuseBathymetryTsunami.py"
)
...
...
@@ -24,7 +24,7 @@ FCoriolis= functionC(tlib, "coriolis", 1, [xyz])
claw
=
dgConservationLawShallowWater2d
()
solution
=
dgDofContainer
(
groups
,
claw
.
getNbFields
())
solution
.
interpolate
(
Finit
)
#solution.
readMsh
(outputDir+"/"+filename+"_sol"+"/"+filename+"_sol.idx")
#solution.
importIdx
(outputDir+"/"+filename+"_sol"+"/"+filename+"_sol.idx")
claw
.
setBathymetry
(
bath
.
getFunction
())
claw
.
setBathymetryGradient
(
bath
.
getFunctionGradient
())
claw
.
setCoriolisFactor
(
FCoriolis
)
...
...
benchmarks/MultiRate/ParallelScaling/tsunami/SinglerateScalingTsunami.py
View file @
792dba47
...
...
@@ -14,7 +14,7 @@ bathname=outputDir+"/"+filename+"_bath_smooth"+"/"+filename+"_bath_smooth.idx"
Msg
.
Barrier
()
if
(
os
.
path
.
exists
(
bathname
)):
Msg
.
Info
(
'.... Import Default Smoothed Bathymetry'
)
bath
.
readMsh
(
bathname
)
bath
.
importIdx
(
bathname
)
else
:
Msg
.
Fatal
(
"No correct bathymetry file, launch DiffuseBathymetryTsunami.py"
)
...
...
benchmarks/MultiRate/Testcases/GBR/MultirateGBR.py
View file @
792dba47
...
...
@@ -38,7 +38,7 @@ if(not os.path.exists(bathname)):
Msg
.
Fatal
(
'No valid bathymetry file :'
+
bathname
+
' found, please launch "rundgpy DiffuseBathymetryTsunami.py"'
)
bath
=
dgDofContainer
(
groups
,
1
);
bath
.
readMsh
(
bathname
)
bath
.
importIdx
(
bathname
)
# ************************************************
...
...
benchmarks/MultiRate/Testcases/GBR/PartitionGBR.py
View file @
792dba47
...
...
@@ -19,7 +19,7 @@ bath = dgDofContainer(groups, 1);
if
(
not
os
.
path
.
exists
(
bathname
)):
Msg
.
Fatal
(
'No valid bathymetry file :'
+
bathname
+
' found, please launch "rundgpy DiffuseBathymetryTsunami.py"'
)
bath
.
readMsh
(
bathname
)
bath
.
importIdx
(
bathname
)
# Define Conservation Law
claw
=
dgConservationLawShallowWater2d
()
solution
=
dgDofContainer
(
groups
,
claw
.
getNbFields
())
...
...
benchmarks/MultiRate/Testcases/tsunami/MultirateTsunami.py
View file @
792dba47
...
...
@@ -17,7 +17,7 @@ groups = dgGroupCollection(model, dimension, order, stereo)
XYZ
=
groups
.
getFunctionCoordinates
();
claw
=
dgConservationLawShallowWater2d
()
bath
=
dgDofContainer
(
groups
,
1
);
bath
.
readMsh
(
bathname
)
bath
.
importIdx
(
bathname
)
solution
=
dgDofContainer
(
groups
,
claw
.
getNbFields
())
Finit
=
functionC
(
tlib
,
"initial_condition_okada_honshu"
,
3
,
[
XYZ
])
solution
.
interpolate
(
Finit
)
...
...
benchmarks/MultiRate/Testcases/tsunami/PartitionTsunami.py
View file @
792dba47
...
...
@@ -21,7 +21,7 @@ def loadAndPartitionMesh(model, fileName, ng, algo) :
if
(
not
os
.
path
.
exists
(
bathname
)):
Msg
.
Fatal
(
'No valid bathymetry file :'
+
bathname
+
' found, please launch "rundgpy DiffuseBathymetryTsunami.py"'
)
bath
.
readMsh
(
bathname
)
bath
.
importIdx
(
bathname
)
claw
=
dgConservationLawShallowWater2d
()
solution
=
dgDofContainer
(
groups
,
claw
.
getNbFields
())
...
...
Prev
1
2
3
4
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment