FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
core/python_wrappers/test_pyCore_with_simx.py at master · SCOREC/core · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
SCOREC
/
core
Public
Notifications
You must be signed in to change notification settings
Fork
69
Star
203
Code
Issues
106
Pull requests
15
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
core
/
python_wrappers
/
test_pyCore_with_simx.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
92 lines (68 loc) · 1.91 KB
Breadcrumbs
core
/
python_wrappers
/
test_pyCore_with_simx.py
Copy path
File metadata and controls
92 lines (68 loc) · 1.91 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
from
mpi4py
import
MPI
import
pyCore
import
sys
,
getopt
def
main
(
argv
):
model
=
''
mesh
=
''
try
:
opts
,
args
=
getopt
.
getopt
(
argv
,
"hg:m:"
,[
"model="
,
"mesh="
])
except
getopt
.
GetoptError
:
print
(
'test_pytCore.py -g <model> -m <mesh>'
)
sys
.
exit
(
2
)
for
opt
,
arg
in
opts
:
if
opt
==
'-h'
:
print
(
'test_pytCore.py -g <model> -m <mesh>'
)
sys
.
exit
()
elif
opt
in
(
"-g"
,
"--model"
):
model
=
arg
elif
opt
in
(
"-m"
,
"--mesh"
):
mesh
=
arg
print
(
'Model file is "'
,
model
)
print
(
'Mesh file is "'
,
mesh
)
pyCore
.
lion_set_verbosity
(
1
)
# PCU initialization
PCUObj
=
pyCore
.
PCU
(
MPI
.
COMM_WORLD
)
# SIMX initialization
pyCore
.
start_sim
(
'simlog.txt'
)
# gmi initialization
pyCore
.
gmi_register_mesh
()
# gmi_sim start
pyCore
.
gmi_sim_start
()
pyCore
.
gmi_register_sim
()
# load the mesh and model and write the initial mesh to vtk
mesh
=
pyCore
.
loadMdsMesh
(
model
,
mesh
,
PCUObj
)
print
(
"num verts in the mesh is "
,
mesh
.
count
(
0
))
it
=
mesh
.
begin
(
0
)
while
True
:
e
=
mesh
.
iterate
(
it
)
if
(
not
e
):
break
p
=
pyCore
.
Vector3
()
mesh
.
getPoint
(
e
,
0
,
p
)
print
(
p
.
x
(),
p
.
y
(),
p
.
z
())
print
(
mesh
.
getModelTag
(
mesh
.
toModel
(
e
)))
mesh
.
end
(
it
)
pyCore
.
writeASCIIVtkFiles
(
'before'
,
mesh
);
# setup uniform refiner and call mesh adapt
ma_input
=
pyCore
.
configureUniformRefine
(
mesh
,
2
);
pyCore
.
adapt
(
ma_input
);
it
=
mesh
.
begin
(
0
)
while
True
:
e
=
mesh
.
iterate
(
it
)
if
(
not
e
):
break
p
=
pyCore
.
Vector3
()
mesh
.
getPoint
(
e
,
0
,
p
)
print
(
p
.
x
(),
p
.
y
(),
p
.
z
())
print
(
mesh
.
getModelTag
(
mesh
.
toModel
(
e
)))
mesh
.
end
(
it
)
# write the adapted mesh to vtk
pyCore
.
writeASCIIVtkFiles
(
'after'
,
mesh
);
# gmi_sim stop
pyCore
.
gmi_sim_stop
()
# SIMX finalization
pyCore
.
stop_sim
()
# gmi finalization
del
PCUObj
if
__name__
==
"__main__"
:
main
(
sys
.
argv
[
1
:])
Back
|
FazBrowse Home
|
New Git URL