Forked from
Klaus Böhnlein / dune-microstructure
474 commits behind, 275 commits ahead of the upstream repository.
-
Klaus Böhnlein authoredKlaus Böhnlein authored
orthotropicrotation_2.py 2.44 KiB
import math
import ctypes
import os
import sys
import numpy as np
class ParameterSet(dict):
def __init__(self, *args, **kwargs):
super(ParameterSet, self).__init__(*args, **kwargs)
self.__dict__ = self
parameterSet = ParameterSet()
#---------------------------------------------------------------
#--- define indicator function
def indicatorFunction(x):
if x[2] > 0.25:
return 1 #Phase1
elif (abs(x[2]) < 0.25):
return 2 #Phase2
else:
return 3 #Phase3
########### Options for material phases: #################################
# 1. "isotropic" 2. "orthotropic" 3. "transversely_isotropic" 4. "general_anisotropic"
#########################################################################
## Notation - Parameter input :
# isotropic (Lame parameters) : [mu , lambda]
# orthotropic : [E1,E2,E3,G12,G23,G31,nu12,nu13,nu23] # see https://en.wikipedia.org/wiki/Poisson%27s_ratio with x=1,y=2,z=3
# transversely_isotropic : [E1,E2,G12,nu12,nu23]
# general_anisotropic : full compliance matrix C
######################################################################
# --- Number of material phases
parameterSet.Phases=3
# *Rotate material frame of each phase by 180 degrees (pi)
#--- Define different material phases:
#- PHASE 1
parameterSet.phase1_type="orthotropic"
materialParameters_phase1 = [11.2e3,630,1190,700,230,960,0.63,0.49,0.37] # Walnut parameters (values for compliance matrix) see [Dimwoodie; Timber its nature and behavior p.109]
parameterSet.phase1_axis = 0
parameterSet.phase1_angle = np.pi
#- PHASE 2
parameterSet.phase2_type="orthotropic"
materialParameters_phase2 = [16.3e3,620,1100,910,190,1180,0.43,0.49,0.38] # Birch parameters (values for compliance matrix) see [Dimwoodie; Timber its nature and behavior p.109]
parameterSet.phase2_axis = 1
parameterSet.phase2_angle = np.pi
#- PHASE 3
parameterSet.phase3_type="orthotropic"
materialParameters_phase3 = [10.7e3,430,710,620,23,500,0.51,0.38,0.31] # Norway spruce parameters (values for compliance matrix) see [Dimwoodie; Timber its nature and behavior p.109]
parameterSet.phase3_axis = 2
parameterSet.phase3_angle = np.pi
#--- define prestrain function for each phase
# (also works with non-constant values)
def prestrain_phase1(x):
return [[2, 0, 0], [0,2,0], [0,0,2]]
def prestrain_phase2(x):
return [[1, 0, 0], [0,1,0], [0,0,1]]
def prestrain_phase3(x):
return [[0, 0, 0], [0,0,0], [0,0,0]]