Newer
Older
class ParameterSet(dict):
def __init__(self, *args, **kwargs):
super(ParameterSet, self).__init__(*args, **kwargs)
self.__dict__ = self
parameterSet = ParameterSet()
# Interpolation method
parameterSet.interpolationMethod = "geodesic"
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
#############################################
# Grid parameters
#############################################
# Number of grid levels
parameterSet.numLevels = 4
# Number of elements of the rod grid
parameterSet.numRodBaseElements = 5
#############################################
# Solver parameters
#############################################
# Tolerance of the trust region solver
parameterSet.tolerance = 1e-6
# Max number of steps of the trust region solver
parameterSet.maxTrustRegionSteps = 100
parameterSet.solverScaling = "1 1 1 0.01 0.01 0.01"
# Initial trust-region radius
parameterSet.initialTrustRegionRadius = 1
# Number of multigrid iterations per trust-region step
parameterSet.numIt = 200
# Number of presmoothing steps
parameterSet.nu1 = 3
# Number of postsmoothing steps
parameterSet.nu2 = 3
# Number of coarse grid corrections
parameterSet.mu = 1
# Number of base solver iterations
parameterSet.baseIt = 100
# Tolerance of the multigrid solver
parameterSet.mgTolerance = 1e-10
# Tolerance of the base grid solver
parameterSet.baseTolerance = 1e-8
parameterSet.instrumented = "no"
# Material parameters
############################
radius = 0.02
parameterSet.A = math.pi * radius**2
parameterSet.J1 = math.pi * 0.25 * radius**4
parameterSet.J2 = math.pi * 0.25 * radius**4
parameterSet.E = 2.5e5
parameterSet.nu = 0.3
#############################################
# Boundary values
#############################################
class ReferenceConfiguration:
def deformation(self, x):
def orientation(self, x):
return [[1,0,0], [0,1,0], [0,0,1]]
### Python predicate specifying all Dirichlet grid vertices
# x is the vertex coordinate
parameterSet.dirichletVerticesPredicate = "[x[0] < 0.001 or x[0] > 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
class DirichletValues:
def deformation(self, x):
def orientation(self, x):
return [[1,0,0], [0,1,0], [0,0,1]]