Skip to content
Snippets Groups Projects
Commit b981580d authored by Klaus Böhnlein's avatar Klaus Böhnlein
Browse files

add microproblem of buckling_experiment

parent 84f5606a
No related branches found
No related tags found
1 merge request!13Feature: IndexedMicrostructure (Definition of individual macroscopic microstructure-phases)
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()
#############################################
# Paths
#############################################
parameterSet.resultPath = '/home/klaus/Desktop/Dune_bendIso/dune-microstructure/outputs_buckling_microproblem'
parameterSet.baseName= 'buckling_microproblem'
##################### MICROSCALE PROBLEM ####################
class Microstructure:
def __init__(self):
# self.macroPoint = macroPoint
self.gamma = 1.0 #in the future this might change depending on macroPoint.
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]
#- PHASE 2
self.phase2_type="isotropic"
self.materialParameters_phase2 = [100, 1.0]
#--- Indicator function for material phases
def indicatorFunction(self,x):
# if (abs(x[0]) < (theta/2) and x[2] >= 0 ):
if (abs(x[0]) < (1.0/4.0) and x[2] >= 0 ):
return 1 #Phase1
else :
return 2 #Phase2
#--- Define prestrain function for each phase (also works with non-constant values)
def prestrain_phase1(self,x):
# return [[2, 0, 0], [0,2,0], [0,0,2]]
# rho = 1.0
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]]
#############################################
# Grid parameters
#############################################
parameterSet.microGridLevel = 4
#############################################
# Assembly options
#############################################
parameterSet.set_IntegralZero = 1 #(default = false)
parameterSet.set_oneBasisFunction_Zero = 1 #(default = false)
#parameterSet.arbitraryLocalIndex = 7 #(default = 0)
#parameterSet.arbitraryElementNumber = 3 #(default = 0)
#############################################
# Solver Options, Type: #1: CG - SOLVER , #2: GMRES - SOLVER, #3: QR - SOLVER, #4: UMFPACK - SOLVER (default)
#############################################
parameterSet.Solvertype = 4 # recommended to use iterative solver (e.g GMRES) for finer grid-levels
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
# --- (Additional debug output)
parameterSet.print_debug = 0 #(default=false)
parameterSet.print_corrector_matrices = 0
# --- Write Correctos to VTK-File:
parameterSet.writeCorrectorsVTK = 1
# --- Use caching of element matrices:
parameterSet.cacheElementMatrices = 1
# --- check orthogonality (75) from paper:
parameterSet.write_checkOrthogonality = 0
# --- write effective quantities (Qhom.Beff) to .txt-files
parameterSet.write_EffectiveQuantitiesToTxt = True
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment