diff --git a/experiment/micro-problem/fibreRotation_microproblem.py b/experiment/micro-problem/fibreRotation_microproblem.py new file mode 100644 index 0000000000000000000000000000000000000000..1e4505dbb90b2858d599948487daadee488f7cc0 --- /dev/null +++ b/experiment/micro-problem/fibreRotation_microproblem.py @@ -0,0 +1,107 @@ +import math +import numpy as np + +class ParameterSet(dict): + def __init__(self, *args, **kwargs): + super(ParameterSet, self).__init__(*args, **kwargs) + self.__dict__ = self + +parameterSet = ParameterSet() + +"""" + Experiment: Microstructure + featuring prestrained isotopic fibres located + in the top layer aligned diagonally with an angle alpha + + theta: fibreRadius + +""" + +############################################# +# Paths +############################################# +parameterSet.resultPath = '/home/klaus/Desktop/Dune_bendIso/dune-microstructure/outputs_buckling_microproblem' +parameterSet.baseName= 'fibreRotation_microproblem' + +##################### MICROSCALE PROBLEM #################### +class Microstructure: + def __init__(self): + # self.macroPoint = macroPoint + self.gamma = 2 + self.phases = 2 #in the future this might change depending on macroPoint. + #--- Define different material phases: + #- PHASE 1 + self.phase1_type="isotropic" + # self.materialParameters_phase1 = [200, 1.0] + self.materialParameters_phase1 = [28.7,22.5] # glass (Fibre) + + #- PHASE 2 + self.phase2_type="isotropic" + # self.materialParameters_phase2 = [100, 1.0] + self.materialParameters_phase2 = [1.2,2.58] #Matrix-material: polystyrene + + + self.theta = 0.2 + self.alpha = 1.0471975511965976 + + #--- Indicator function for material phases + def indicatorFunction(self,x): + if (abs(-np.cos(self.alpha)*x[0] + np.sin(self.alpha)*x[1] ) < self.theta and x[2] >= 0 ): + return 1 #Phase1 + else : + return 2 #Phase2 + + #--- Define prestrain function for each phase + def prestrain_phase1(self,x): + rho = 1.0 + return [[rho*1.0, 0, 0], [0,rho*1.0,0], [0,0,rho*1.0]] + + def prestrain_phase2(self,x): + return [[0, 0, 0], [0,0,0], [0,0,0]] + + +parameterSet.printMicroOutput = 1 # Flag that allows to supress the output of the micro-problem. + +############################################# +# Grid parameters +############################################# +parameterSet.microGridLevel = 4 + +############################################# +# Assembly options +############################################# +parameterSet.set_IntegralZero = 1 #(default = false, This overwrites the option 'set_oneBasisFunction_Zero') +parameterSet.set_oneBasisFunction_Zero = 1 #(default = false) +# parameterSet.arbitraryLocalIndex = 7 #(default = 0) +# parameterSet.arbitraryElementNumber = 3 #(default = 0) +parameterSet.cacheElementMatrices = 1 # Use caching of element matrices + +############################################# +# Solver Options, Type: #1: CHOLMOD (default) | #2: UMFPACK | #3: GMRES | #4 CG | #5 QR: +# (maybe switch to an iterative solver (e.g. GMRES) if direct solver (CHOLMOD/UMFPACK) runs out of memory for too fine grids) +############################################# +parameterSet.Solvertype = 1 +parameterSet.Solver_verbosity = 0 # (default = 2) degree of information for solver output + +############################################# +# Write/Output options #(default=false) +############################################# +# --- (Optional output) write Material / prestrain / Corrector functions to .vtk-Files: +parameterSet.write_materialFunctions = 1 # VTK indicator function for material/prestrain definition +#parameterSet.write_prestrainFunctions = 1 # VTK norm of B (currently not implemented) +parameterSet.MaterialSubsamplingRefinement= 2 +# --- Write Correctos to VTK-File: +parameterSet.writeCorrectorsVTK = 1 +# --- write effective quantities (Qhom.Beff) to .txt-files +parameterSet.write_EffectiveQuantitiesToTxt = True + +############################################# +# Debug options +############################################# +parameterSet.print_debug = 0 #(default=false) +parameterSet.print_conditionNumber = 0 +parameterSet.print_corrector_matrices = 0 +parameterSet.write_checkOrthogonality = 0 #Check orthogonality (75) from the paper. + + +