Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gfe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Sander, Oliver
dune-gfe
Commits
5c4e6462
Commit
5c4e6462
authored
6 months ago
by
Sander, Oliver
Browse files
Options
Downloads
Patches
Plain Diff
rod WIP
parent
22a6e938
No related branches found
No related tags found
1 merge request
!163
Improve Cosserat rod code
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
problems/cosserat-rod-example.py
+11
-7
11 additions, 7 deletions
problems/cosserat-rod-example.py
with
11 additions
and
7 deletions
problems/cosserat-rod-example.py
+
11
−
7
View file @
5c4e6462
import
math
class
ParameterSet
(
dict
):
class
ParameterSet
(
dict
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
ParameterSet
,
self
).
__init__
(
*
args
,
**
kwargs
)
super
(
ParameterSet
,
self
).
__init__
(
*
args
,
**
kwargs
)
...
@@ -64,9 +66,9 @@ parameterSet.instrumented = "no"
...
@@ -64,9 +66,9 @@ parameterSet.instrumented = "no"
# Material parameters
# Material parameters
############################
############################
parameterSet
.
A
=
1
parameterSet
.
A
=
1
e-4
parameterSet
.
J1
=
1
parameterSet
.
J1
=
1
e-4
parameterSet
.
J2
=
1
parameterSet
.
J2
=
1
e-4
parameterSet
.
E
=
2.5e5
parameterSet
.
E
=
2.5e5
parameterSet
.
nu
=
0.3
parameterSet
.
nu
=
0.3
...
@@ -76,20 +78,22 @@ parameterSet.nu = 0.3
...
@@ -76,20 +78,22 @@ parameterSet.nu = 0.3
class
ReferenceConfiguration
:
class
ReferenceConfiguration
:
def
deformation
(
self
,
x
):
def
deformation
(
self
,
x
):
return
[
0
,
0
,
x
[
0
]]
return
[
x
[
0
]
,
0
,
0
]
def
orientation
(
self
,
x
):
def
orientation
(
self
,
x
):
return
[[
1
,
0
,
0
],
[
0
,
1
,
0
],
[
0
,
0
,
1
]]
return
[[
1
,
0
,
0
],
[
0
,
1
,
0
],
[
0
,
0
,
1
]]
### Python predicate specifying all Dirichlet grid vertices
### Python predicate specifying all Dirichlet grid vertices
# x is the vertex coordinate
# x is the vertex coordinate
parameterSet
.
dirichletVerticesPredicate
=
"
[x[2] < 0.001 or x[2] > 0.999, x[2] < 0.001 or x[2] > 0.999, x[2] < 0.001 or x[2] > 0.999]
"
parameterSet
.
dirichletVerticesPredicate
=
"
[x[0] < 0.001 or x[0] > 0.999,
\
parameterSet
.
dirichletRotationVerticesPredicate
=
"
x[2] < 0.001 or x[2] > 0.999
"
x[0] < 0.001 or x[0] > 0.999,
\
x[0] < 0.001 or x[0] > 0.999]
"
parameterSet
.
dirichletRotationVerticesPredicate
=
"
x[0] < 0.001 or x[0] > 0.999
"
# Dirichlet values and initial iterate
# Dirichlet values and initial iterate
class
DirichletValues
:
class
DirichletValues
:
def
deformation
(
self
,
x
):
def
deformation
(
self
,
x
):
return
[
0
,
0
,
x
[
0
]]
return
[
x
[
0
]
*
0.5
,
0
,
0.1
*
math
.
sin
(
x
[
0
]
*
math
.
pi
)
]
def
orientation
(
self
,
x
):
def
orientation
(
self
,
x
):
return
[[
1
,
0
,
0
],
[
0
,
1
,
0
],
[
0
,
0
,
1
]]
return
[[
1
,
0
,
0
],
[
0
,
1
,
0
],
[
0
,
0
,
1
]]
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