Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dolfin_dic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
BERBEROGLU Ezgi
dolfin_dic
Commits
7b79a4ee
Commit
7b79a4ee
authored
5 years ago
by
Martin Genet
Browse files
Options
Downloads
Patches
Plain Diff
In write twist vs height, now selects points as a function of radial position
parent
f2e59f9e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compute_strains.py
+22
-18
22 additions, 18 deletions
compute_strains.py
with
22 additions
and
18 deletions
compute_strains.py
+
22
−
18
View file @
7b79a4ee
...
...
@@ -33,8 +33,8 @@ def compute_strains(
ref_mesh_basename
=
None
,
ref_mesh_ext
=
"
vtk
"
,
CYL_or_PPS
=
"
PPS
"
,
remove_boundary_layer
=
True
,
in_place
=
True
,
remove_boundary_layer
=
1
,
in_place
=
1
,
write_strains
=
1
,
temporal_offset
=
None
,
temporal_resolution
=
None
,
...
...
@@ -122,7 +122,7 @@ def compute_strains(
if
(
write_twist_vs_height
):
twist_vs_height_file
=
open
(
working_folder
+
"
/
"
+
working_basename
+
"
-twist_vs_height.dat
"
,
"
w
"
)
twist_vs_height_file
.
write
(
"
#t z
z
beta
\n
"
)
twist_vs_height_file
.
write
(
"
#t z beta
\n
"
)
if
(
ref_frame
is
not
None
):
mesh0_filename
=
working_folder
+
"
/
"
+
working_basename
+
"
_
"
+
str
(
ref_frame
).
zfill
(
working_zfill
)
+
"
.
"
+
working_ext
...
...
@@ -159,6 +159,7 @@ def compute_strains(
mesh
.
GetCellData
().
AddArray
(
ref_mesh
.
GetCellData
().
GetArray
(
"
rr
"
))
if
(
write_twist_vs_height
):
assert
(
ref_mesh
.
GetPointData
().
HasArray
(
"
ll
"
))
mesh
.
GetPointData
().
AddArray
(
ref_mesh
.
GetPointData
().
GetArray
(
"
r
"
))
mesh
.
GetPointData
().
AddArray
(
ref_mesh
.
GetPointData
().
GetArray
(
"
ll
"
))
myvtk
.
addDeformationGradients
(
mesh
=
mesh
,
...
...
@@ -281,29 +282,30 @@ def compute_strains(
verbose
=
verbose
)
C
=
points_AB
.
GetPoint
(
0
)
farray_r
=
mesh
.
GetPointData
().
GetArray
(
"
r
"
)
farray_ll
=
mesh
.
GetPointData
().
GetArray
(
"
ll
"
)
farray_U
=
mesh
.
GetPointData
().
GetArray
(
disp_array_name
)
#
farray_Theta = myvtk.createFloatArray(
#
name="Theta",
#
n_components=1,
#
n_tuples=n_points)
#
farray_theta = myvtk.createFloatArray(
#
name="theta",
#
n_components=1,
#
n_tuples=n_points)
farray_U
=
mesh
.
GetPointData
().
GetArray
(
disp_array_name
)
farray_Theta
=
myvtk
.
createFloatArray
(
name
=
"
Theta
"
,
n_components
=
1
,
n_tuples
=
n_points
)
farray_theta
=
myvtk
.
createFloatArray
(
name
=
"
theta
"
,
n_components
=
1
,
n_tuples
=
n_points
)
farray_beta
=
myvtk
.
createFloatArray
(
name
=
"
beta
"
,
n_components
=
1
,
n_tuples
=
n_points
)
#
mesh.GetPointData().AddArray(farray_Theta)
#
mesh.GetPointData().AddArray(farray_theta)
mesh
.
GetPointData
().
AddArray
(
farray_Theta
)
mesh
.
GetPointData
().
AddArray
(
farray_theta
)
mesh
.
GetPointData
().
AddArray
(
farray_beta
)
X
=
numpy
.
empty
(
3
)
U
=
numpy
.
empty
(
3
)
x
=
numpy
.
empty
(
3
)
for
k_point
in
xrange
(
n_points
):
r
=
farray_r
.
GetTuple1
(
k_point
)
ll
=
farray_ll
.
GetTuple1
(
k_point
)
if
(
ll
<
1.
/
3
):
continue
mesh
.
GetPoint
(
k_point
,
X
)
X
-=
C
Theta
=
math
.
degrees
(
math
.
atan2
(
X
[
1
],
X
[
0
]))
...
...
@@ -313,9 +315,11 @@ def compute_strains(
beta
=
theta
-
Theta
if
(
beta
>
+
180.
):
beta
-=
360.
if
(
beta
<
-
180.
):
beta
+=
360.
#
farray_Theta.SetTuple1(k_point, Theta)
#
farray_theta.SetTuple1(k_point, theta)
farray_Theta
.
SetTuple1
(
k_point
,
Theta
)
farray_theta
.
SetTuple1
(
k_point
,
theta
)
farray_beta
.
SetTuple1
(
k_point
,
beta
)
if
(
r
<
15.
):
continue
# if (ll < 1./3): continue
twist_vs_height_file
.
write
(
"
"
.
join
([
str
(
val
)
for
val
in
[
k_frame
,
ll
,
beta
]])
+
"
\n
"
)
mesh_filename
=
working_folder
+
"
/
"
+
working_basename
+
(
"
-wStrains
"
)
*
(
not
in_place
)
+
"
_
"
+
str
(
k_frame
).
zfill
(
working_zfill
)
+
"
.
"
+
working_ext
myvtk
.
writeUGrid
(
...
...
@@ -368,6 +372,6 @@ def compute_strains(
if
(
plot_twist_vs_height
):
ddic
.
plot_twist_vs_height
(
working_folder
=
working_folder
,
working_basename
s
=
[
working_basename
]
,
working_basename
=
working_basename
,
suffix
=
None
,
verbose
=
verbose
)
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