Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CardMech
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
KIT
Mpp
CardMech
Commits
a22f9a3f
Commit
a22f9a3f
authored
3 years ago
by
jonathan.froehlich
Browse files
Options
Downloads
Patches
Plain Diff
Adjusted boundary conditions in cuboids
parent
6b55e945
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!153
Local add output info
,
!144
Debug cardmech
,
!117
Resolve "Fix volumetric derivatives"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tools/geometries/generate_cuboids.py
+24
-24
24 additions, 24 deletions
tools/geometries/generate_cuboids.py
tools/geometries/utility/geo.py
+1
-2
1 addition, 2 deletions
tools/geometries/utility/geo.py
tools/geometries/vtu_to_mesh.py
+2
-2
2 additions, 2 deletions
tools/geometries/vtu_to_mesh.py
with
27 additions
and
28 deletions
tools/geometries/generate_cuboids.py
+
24
−
24
View file @
a22f9a3f
...
...
@@ -246,12 +246,12 @@ class CuboidGenerator:
# Faces
for
j
in
range
(
y
*
D
):
for
k
in
range
(
z
*
D
):
if
self
.
bnd
.
left
>
0
:
if
self
.
bnd
.
left
>
=
0
:
for
face
in
tt
.
square_to_triangles
(
*
tt
.
cube_face_x
(
points
,
0
,
j
,
k
)):
face_id
=
geometry
.
add_face
(
face
)
geometry
.
add_bnd_condition
(
face_id
,
self
.
bnd
.
left
)
if
self
.
bnd
.
right
>
0
:
if
self
.
bnd
.
right
>
=
0
:
for
face
in
tt
.
square_to_triangles
(
*
tt
.
cube_face_x
(
points
,
x
*
D
,
j
,
k
)):
face_id
=
geometry
.
add_face
(
face
)
geometry
.
add_bnd_condition
(
face_id
,
self
.
bnd
.
right
)
...
...
@@ -259,24 +259,24 @@ class CuboidGenerator:
'''
Insert Pressure Boundary on Top and Bottom
'''
for
i
in
range
(
x
*
D
):
for
j
in
range
(
y
*
D
):
if
self
.
bnd
.
upper
>
0
:
if
self
.
bnd
.
upper
>
=
0
:
for
face
in
tt
.
square_to_triangles
(
*
tt
.
cube_face_z
(
points
,
i
,
j
,
z
*
D
)):
face_id
=
geometry
.
add_face
(
face
)
geometry
.
add_bnd_condition
(
face_id
,
self
.
bnd
.
upper
)
if
self
.
bnd
.
lower
>
0
:
if
self
.
bnd
.
lower
>
=
0
:
for
face
in
tt
.
square_to_triangles
(
*
tt
.
cube_face_z
(
points
,
i
,
j
,
0
)):
face_id
=
geometry
.
add_face
(
face
)
geometry
.
add_bnd_condition
(
face_id
,
self
.
bnd
.
lower
)
for
i
in
range
(
x
*
D
):
for
k
in
range
(
z
*
D
):
if
self
.
bnd
.
front
>
0
:
if
self
.
bnd
.
front
>
=
0
:
for
face
in
tt
.
square_to_triangles
(
*
tt
.
cube_face_y
(
points
,
i
,
0
,
k
)):
face_id
=
geometry
.
add_face
(
face
)
geometry
.
add_bnd_condition
(
face_id
,
self
.
bnd
.
front
)
if
self
.
bnd
.
back
>
0
:
if
self
.
bnd
.
back
>
=
0
:
for
face
in
tt
.
square_to_triangles
(
*
tt
.
cube_face_y
(
points
,
i
,
y
*
D
,
k
)):
face_id
=
geometry
.
add_face
(
face
)
geometry
.
add_bnd_condition
(
face_id
,
self
.
bnd
.
back
)
...
...
@@ -323,12 +323,12 @@ class CuboidGenerator:
# Faces
for
j
in
range
(
y
*
D
):
for
k
in
range
(
z
*
D
):
if
self
.
bnd
.
left
>
0
:
if
self
.
bnd
.
left
>
=
0
:
for
face
in
tt
.
square_to_triangles
(
*
tt
.
cube_face_x
(
points
,
0
,
j
,
k
)):
face_id
=
geometry
.
add_face
(
face
)
geometry
.
add_bnd_condition
(
face_id
,
self
.
bnd
.
left
)
if
self
.
bnd
.
right
>
0
:
if
self
.
bnd
.
right
>
=
0
:
for
face
in
tt
.
square_to_triangles
(
*
tt
.
cube_face_x
(
points
,
x
*
D
,
j
,
k
)):
face_id
=
geometry
.
add_face
(
face
)
geometry
.
add_bnd_condition
(
face_id
,
self
.
bnd
.
right
)
...
...
@@ -336,24 +336,24 @@ class CuboidGenerator:
'''
Insert Pressure Boundary on Top and Bottom
'''
for
i
in
range
(
x
*
D
):
for
j
in
range
(
y
*
D
):
if
self
.
bnd
.
upper
>
0
:
if
self
.
bnd
.
upper
>
=
0
:
for
face
in
tt
.
square_to_triangles
(
*
tt
.
cube_face_z
(
points
,
i
,
j
,
z
*
D
)):
face_id
=
geometry
.
add_face
(
face
)
geometry
.
add_bnd_condition
(
face_id
,
self
.
bnd
.
upper
)
if
self
.
bnd
.
lower
>
0
:
if
self
.
bnd
.
lower
>
=
0
:
for
face
in
tt
.
square_to_triangles
(
*
tt
.
cube_face_z
(
points
,
i
,
j
,
0
)):
face_id
=
geometry
.
add_face
(
face
)
geometry
.
add_bnd_condition
(
face_id
,
self
.
bnd
.
lower
)
for
i
in
range
(
x
*
D
):
for
k
in
range
(
z
*
D
):
if
self
.
bnd
.
front
>
0
:
if
self
.
bnd
.
front
>
=
0
:
for
face
in
tt
.
square_to_triangles
(
*
tt
.
cube_face_y
(
points
,
i
,
0
,
k
)):
face_id
=
geometry
.
add_face
(
face
)
geometry
.
add_bnd_condition
(
face_id
,
self
.
bnd
.
front
)
if
self
.
bnd
.
back
>
0
:
if
self
.
bnd
.
back
>
=
0
:
for
face
in
tt
.
square_to_triangles
(
*
tt
.
cube_face_y
(
points
,
i
,
y
*
D
,
k
)):
face_id
=
geometry
.
add_face
(
face
)
geometry
.
add_bnd_condition
(
face_id
,
self
.
bnd
.
back
)
...
...
@@ -391,24 +391,24 @@ class CuboidGenerator:
'''
Insert Dirichlet Boundary
'''
for
j
in
range
(
y
*
D
):
for
k
in
range
(
z
*
D
):
if
self
.
bnd
.
left
>
0
:
if
self
.
bnd
.
left
>
=
0
:
geometry
.
add_bnd_condition
(
geometry
.
add_face
(
tt
.
cube_face_x
(
points
,
0
,
j
,
k
)),
self
.
bnd
.
left
)
if
self
.
bnd
.
right
>
0
:
if
self
.
bnd
.
right
>
=
0
:
geometry
.
add_bnd_condition
(
geometry
.
add_face
(
tt
.
cube_face_x
(
points
,
x
*
D
,
j
,
k
)),
self
.
bnd
.
right
)
'''
Insert Pressure Boundary on Top and Bottom
'''
for
i
in
range
(
x
*
D
):
for
j
in
range
(
y
*
D
):
if
self
.
bnd
.
lower
>
0
:
if
self
.
bnd
.
lower
>
=
0
:
geometry
.
add_bnd_condition
(
geometry
.
add_face
(
tt
.
cube_face_z
(
points
,
i
,
j
,
0
)),
self
.
bnd
.
lower
)
if
self
.
bnd
.
upper
>
0
:
if
self
.
bnd
.
upper
>
=
0
:
geometry
.
add_bnd_condition
(
geometry
.
add_face
(
tt
.
cube_face_z
(
points
,
i
,
j
,
z
*
D
)),
self
.
bnd
.
upper
)
for
i
in
range
(
x
*
D
):
for
k
in
range
(
z
*
D
):
if
self
.
bnd
.
front
>
0
:
if
self
.
bnd
.
front
>
=
0
:
geometry
.
add_bnd_condition
(
geometry
.
add_face
(
tt
.
cube_face_y
(
points
,
i
,
0
,
k
)),
self
.
bnd
.
front
)
if
self
.
bnd
.
back
>
0
:
if
self
.
bnd
.
back
>
=
0
:
geometry
.
add_bnd_condition
(
geometry
.
add_face
(
tt
.
cube_face_y
(
points
,
i
,
y
*
D
,
k
)),
self
.
bnd
.
back
)
geometry
.
init_data
()
...
...
@@ -454,24 +454,24 @@ class CuboidGenerator:
'''
Insert Dirichlet Boundary
'''
for
j
in
range
(
y
*
D
):
for
k
in
range
(
z
*
D
):
if
self
.
bnd
.
left
>
0
:
if
self
.
bnd
.
left
>
=
0
:
geometry
.
add_bnd_condition
(
geometry
.
add_face
(
tt
.
cube_face_x
(
points
,
0
,
j
,
k
)),
self
.
bnd
.
left
)
if
self
.
bnd
.
right
>
0
:
if
self
.
bnd
.
right
>
=
0
:
geometry
.
add_bnd_condition
(
geometry
.
add_face
(
tt
.
cube_face_x
(
points
,
x
*
D
,
j
,
k
)),
self
.
bnd
.
right
)
'''
Insert Pressure Boundary on Top and Bottom
'''
for
i
in
range
(
x
*
D
):
for
j
in
range
(
y
*
D
):
if
self
.
bnd
.
lower
>
0
:
if
self
.
bnd
.
lower
>
=
0
:
geometry
.
add_bnd_condition
(
geometry
.
add_face
(
tt
.
cube_face_z
(
points
,
i
,
j
,
0
)),
self
.
bnd
.
lower
)
if
self
.
bnd
.
upper
>
0
:
if
self
.
bnd
.
upper
>
=
0
:
geometry
.
add_bnd_condition
(
geometry
.
add_face
(
tt
.
cube_face_z
(
points
,
i
,
j
,
z
*
D
)),
self
.
bnd
.
upper
)
for
i
in
range
(
x
*
D
):
for
k
in
range
(
z
*
D
):
if
self
.
bnd
.
front
>
0
:
if
self
.
bnd
.
front
>
=
0
:
geometry
.
add_bnd_condition
(
geometry
.
add_face
(
tt
.
cube_face_y
(
points
,
i
,
0
,
k
)),
self
.
bnd
.
front
)
if
self
.
bnd
.
back
>
0
:
if
self
.
bnd
.
back
>
=
0
:
geometry
.
add_bnd_condition
(
geometry
.
add_face
(
tt
.
cube_face_y
(
points
,
i
,
y
*
D
,
k
)),
self
.
bnd
.
back
)
geometry
.
init_data
()
...
...
This diff is collapsed.
Click to expand it.
tools/geometries/utility/geo.py
+
1
−
2
View file @
a22f9a3f
...
...
@@ -64,13 +64,13 @@ def write_properties_oriented(orientations, activation, transform=None):
class
Geometry
:
def
__init__
(
self
,
name
,
path
=
""
,
withdata
=
False
):
self
.
name
=
name
self
.
path
=
path
self
.
points
=
{}
self
.
subdomains
=
{}
self
.
cells
=
{}
self
.
bnd
=
{}
self
.
faces
=
{}
self
.
vdata
=
{}
self
.
cdata
=
{}
...
...
@@ -108,7 +108,6 @@ class Geometry:
def
remove_face
(
self
,
face_index
):
del
self
.
faces
[
face_index
]
del
self
.
bnd
[
face_index
]
def
init_data
(
self
):
self
.
vdata
=
{
i
:
[]
for
i
in
self
.
points
.
keys
()}
...
...
This diff is collapsed.
Click to expand it.
tools/geometries/vtu_to_mesh.py
+
2
−
2
View file @
a22f9a3f
...
...
@@ -134,7 +134,7 @@ def full_ellipsoid_bnd(points):
def
convert_quarter_ellipsoid
():
print
(
"
Start conversion of QuarterEllipsoid
"
)
geo
=
VtuMesh
(
"
vtk/QuarterEllipsoid
"
,
"
QuarterEllipsoid
"
,
True
)
geo
=
VtuMesh
(
"
vtk/QuarterEllipsoid
"
,
"
QuarterEllipsoid
"
,
0.001
)
geo
.
set_boundary_data
(
quarter_ellipsoid_bnd
)
geo
.
read_celldata
([
1
,
2
,
3
])
geo
.
save
()
...
...
@@ -143,7 +143,7 @@ def convert_quarter_ellipsoid():
def
convert_full_ellipsoid
():
print
(
"
Start converion of FullEllipsoid
"
)
geo
=
VtuMesh
(
"
vtk/ellipsoid2Fibers
"
,
"
FullEllipsoid
"
,
True
)
geo
=
VtuMesh
(
"
vtk/ellipsoid2Fibers
"
,
"
FullEllipsoid
"
,
0.001
)
geo
.
set_boundary_data
(
full_ellipsoid_bnd
)
geo
.
read_celldata
([
1
,
2
,
3
])
geo
.
save
()
...
...
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