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 Phases=3 #--- Define different material phases: #- PHASE 1 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] #- PHASE 2 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] #- PHASE 3 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] #--- 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]]