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
2837b3fb
Commit
2837b3fb
authored
Oct 13, 2016
by
Philippe Delandmeter
Browse files
interface3D. Fix after rebase
parent
0454d624
Changes
6
Hide whitespace changes
Inline
Side-by-side
dgpy/scripts/CMakeLists.txt
View file @
2837b3fb
...
...
@@ -7,6 +7,7 @@ set(SCRIPTS
SWGW.py
SWNI.py
slim_private.py
slim3d_private.py
dgftp.py
extrude.py
extrudePeriodic.py
...
...
@@ -32,4 +33,5 @@ foreach(SCRIPT ${SCRIPTS})
configure_file
(
"Common.py"
${
CMAKE_CURRENT_BINARY_DIR
}
/Common.py
)
configure_file
(
slim.py
${
CMAKE_BINARY_DIR
}
/slim.py COPYONLY
)
configure_file
(
slimPre.py
${
CMAKE_BINARY_DIR
}
/slimPre.py COPYONLY
)
configure_file
(
slim3d.py
${
CMAKE_BINARY_DIR
}
/slim3d.py COPYONLY
)
endforeach
(
SCRIPT
)
dgpy/scripts/distance.py
View file @
2837b3fb
from
dgpy
import
*
import
numpy
as
np
from
scipy
import
spatial
from
.
import
slim_private
def
_is_string
(
s
)
:
if
sys
.
version_info
>=
(
3
,
0
):
return
isinstance
(
s
,
str
)
else
:
return
isinstance
(
s
,
basestring
)
def
distance
(
mesh
,
physicalTags
,
outputName
=
"dist"
,
nPoints
=
2
,
evaluationPoints
=
None
):
"""
...
...
@@ -18,7 +23,7 @@ def distance (mesh, physicalTags, outputName="dist", nPoints=2, evaluationPoints
first
=
True
if
nPoints
<
2
:
Msg
.
Fatal
(
"There must be at least 2 points by edge"
)
if
slim_private
.
_is_string
(
physicalTags
):
if
_is_string
(
physicalTags
):
physicalTags
=
[
physicalTags
]
# the nodes belonging to the physical tag(s) are stocked in an array
...
...
dgpy/scripts/slim3d.py
View file @
2837b3fb
import
dgpy
import
slim_private
from
dgpy.scripts
import
slim3d_private
from
dgpy.scripts
import
slim_private
class
Domain
:
"""Create the slim3d Domain"""
...
...
@@ -228,7 +229,7 @@ class Loop:
self
.
_restart_ind
=
index
def
setup
(
self
):
slim_private
.
slim3d_setup
.
slim3d_setup
(
self
)
slim
3d
_private
.
slim3d_setup
(
self
)
slimSolver
=
self
.
_slimSolver
if
dgpy
.
Msg
.
GetCommRank
()
==
0
:
if
not
slim_private
.
path
.
exists
(
self
.
_odir
):
...
...
dgpy/scripts/slim3d_
setup
.py
→
dgpy/scripts/slim3d_
private
.py
View file @
2837b3fb
...
...
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
import
dgpy
import
slim_private
from
dgpy.scripts
import
slim_private
import
numpy
def
slim3d_setup
(
loop
):
...
...
@@ -17,7 +17,7 @@ def slim3d_setup(loop):
if
eq
.
_gotm_option_file
:
slimSolver
.
turbulenceSetupFile
=
'eq._gotm_option_file'
else
:
gotmFileStr
=
slim_private
.
slim3d_setup
.
gotmOptionFile
gotmFileStr
=
gotmOptionFile
f
=
open
(
'gotmturb.nml'
,
'w'
)
f
.
write
(
gotmFileStr
)
f
.
close
()
...
...
dgpy/scripts/slimPre.py
View file @
2837b3fb
...
...
@@ -76,7 +76,6 @@
"""
import
dgpy
from
dgpy.scripts
import
slim_private
from
dgpy.scripts
import
distance
import
numpy
as
np
class
Mesh
:
...
...
@@ -838,7 +837,7 @@ def get_distance(region, physical_tags):
vector containing the physical tags from which the minimum distance will be computed
"""
xyz
=
region
.
coordinates
dist
=
distance
.
distance
(
region
.
_mesh
,
physical_tags
,
evaluationPoints
=
xyz
)
dist
=
slim_private
.
distance
.
distance
(
region
.
_mesh
,
physical_tags
,
evaluationPoints
=
xyz
)
return
np
.
array
(
dist
)
def
extrude
(
mesh_file_name
,
bath_file_name
,
nb_layers
=
None
,
z_layers
=
None
,
layers_function
=
None
,
mesh_file_name_out
=
''
,
factor_show
=
0
,
periodicity
=
None
):
...
...
dgpy/scripts/slim_private.py
View file @
2837b3fb
...
...
@@ -4,14 +4,14 @@ import calendar
import
numpy
as
np
import
math
import
sys
from
.
import
dgftp
from
os
import
path
,
makedirs
,
remove
import
shutil
import
dgpy.mesh
as
mesh
import
dgpy.extrude
as
extrude
import
dgpy.periodicMap
as
periodicMap
import
dgpy.extrudePeriodic
as
extrudePeriodic
from
dgpy.slim3d_setup
import
slim3d_setup
from
dgpy.scripts
import
dgftp
from
dgpy.scripts
import
mesh
from
dgpy.scripts
import
extrude
from
dgpy.scripts
import
periodicMap
from
dgpy.scripts
import
extrudePeriodic
from
dgpy.scripts
import
distance
import
time
class
_velocity_extractor
:
...
...
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