diff --git a/dune/microstructure/prestrain_material_geometry.hh b/dune/microstructure/prestrain_material_geometry.hh index ae4560d6e10c7a366d09b772eee5324544f1e208..e1f4f23cdce23b3700a5c14d61874b8d98617b45 100644 --- a/dune/microstructure/prestrain_material_geometry.hh +++ b/dune/microstructure/prestrain_material_geometry.hh @@ -18,7 +18,7 @@ using std::cos; -template <int dim> +template <int dim> class IsotropicMaterialImp { @@ -78,6 +78,21 @@ public: return mu2; }; + return muTerm; + } + else if (imp == "parametrized_Laminate"){ + double mu1 = parameters.get<double>("mu1",10.0); + double beta = parameters.get<double>("beta",2.0); + double mu2 = beta*mu1; + + auto muTerm = [mu1, mu2, theta] (const Domain& z) { +// std::cout << "Analytical-MU is used" << std::endl; + if (abs(z[0]) > (theta/2.0)) + return mu1; + else + return mu2; + }; + return muTerm; } else if (imp == "circle_fiber"){ @@ -432,6 +447,21 @@ public: else return lambda2; }; + return lambdaTerm; + } + else if (imp == "parametrized_Laminate"){ + double lambda1 = parameters.get<double>("lambda1",0.0); + double beta = parameters.get<double>("beta",2.0); + double lambda2 = beta*lambda1; + + auto lambdaTerm = [lambda1,lambda2, theta] (const Domain& z) { + +// std::cout << "Analytical-LAMBDA is used" << std::endl; //TEST + if (abs(z[0]) > (theta/2.0)) + return lambda1; + else + return lambda2; + }; return lambdaTerm; } else if (imp == "circle_fiber"){ @@ -841,6 +871,20 @@ public: std::cout <<" Prestrain Type: analytical_Example "<< std::endl; return B; } + else if (imp == "parametrized_Laminate") + { + Func2Tensor B = [p1,p2,theta] (const Domain& x) + { + if (abs(x[0]) < (theta/2) && x[2] < 0 ) + return MatrixRT{{p2, 0.0 , 0.0}, {0.0, p2, 0.0}, {0.0, 0.0, p2}}; + else if (abs(x[0]) > (theta/2) && x[2] > 0 ) + return MatrixRT{{p1, 0.0 , 0.0}, {0.0, p1, 0.0}, {0.0, 0.0, p1}}; + else + return MatrixRT{{0.0, 0.0 , 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}}; + }; + std::cout <<" Prestrain Type: analytical_Example "<< std::endl; + return B; + } else if (imp == "circle_fiber"){ Func2Tensor B = [p1,theta,width] (const Domain& x) // Bilayer with one rectangular Fiber & ISOTROPIC PRESSURE diff --git a/inputs/cellsolver.parset b/inputs/cellsolver.parset index 7b723865c77fb2277d1226c73780c3470b448996..d72446f736097940cb2f4b7d8cc37d5d8f045e42 100644 --- a/inputs/cellsolver.parset +++ b/inputs/cellsolver.parset @@ -1,7 +1,7 @@ # --- Parameter File as Input for 'Cell-Problem' -# +# # NOTE: define variables without whitespaces in between! i.e. : gamma=1.0 instead of gamma = 1.0 -# since otherwise these cant be read from other Files! +# since otherwise these cant be read from other Files! # -------------------------------------------------------- @@ -9,113 +9,144 @@ #path for logfile #outputPath = "../../outputs/output.txt" -#outputPath = "/home/klaus/Desktop/DUNE/dune-microstructure/outputs/output.txt" -#outputPath = "/home/klaus/Desktop/DUNE/dune-microstructure/outputs" -############################################# -# Debug Output -############################################# -#print_debug = true #default = false +### Remove/Comment this when running via Python-Script: +outputPath = "../../outputs" +#outputPath = "/home/klaus/Desktop/DUNE/dune-microstructure/outputs/output.txt" +#outputPath = "/home/klaus/Desktop/DUNE/dune-microstructure/outputs" ############################################# -# Grid parameters +# Cell Domain ############################################# +# Domain 1: (-1/2, 1/2)^3 , Domain 2 : [0,1)^2 x (-1/2, 1/2) - -nElements = 32 32 - -gamma=0.25 - +cellDomain = 1 ############################################# -# Material parameters +# Grid parameters ############################################# -write_materialFunctions = true # VTK mu-functions , lambda-functions - -beta = 2.0 # ratio between material parameters mu1 & mu2 .... beta = 1.0 corresponds to homogeneous case -mu1=10.0 -#mu1=1000.0 +####################################################################### +## numLevels : Number of Levels on which solution is computed. starting with a 2x2x2 cube mesh. +## {start,finish} computes on all grid from 2^(start) to 2^finish refinement +######################################################################## -lambda1=10.0 +#numLevels = 1 3 # computes all levels from first to second entry +numLevels = 3 3 # computes all levels from first to second entry +#numLevels = 1 6 -#### material_implementation("analytical_Example") ? - -material_prestrain_imp= "analytical_Example" -#material_prestrain_imp ="isotropic_bilayer" +#Elements_Cell = 20 20 20 # number elements in each direction (y1 y2 x3) +#nElements_Cell = 30 30 30 +#nElements_Cell = 30 30 30 +#nElements_Cell = 50 50 50 +#nElements_Cell = 100 100 2 +#nElements_Cell = 100 100 100 // does not work +#nElements_Cell = 10 10 10 +#nElements_Cell = 2 2 2 +#nElements_Cell = 4 4 4 +#nElements_Cell = 8 8 8 +#nElements_Cell = 16 16 16 +#nElements_Cell = 32 32 32 +#nElements_Cell = 64 64 64 -#material_prestrain_imp= "circle_fiber" #TEST -#material_prestrain_imp= "square_fiber" #TEST +#gamma=50.0 +gamma=1.0 +#gamma=2.5 ############################################# -# Prestrain parameters +# Material parameters ############################################# +beta = 2.0 # ratio between material parameters mu1 & mu2 .... beta = 1.0 corresponds to homogeneous case + +mu1=1.0 +lambda1=0.0 +#lambda1 = 20.0 +#lambda1 = 20.0 +#lambda1 = 5.0 +#mu1=1000.0 -write_prestrainFunctions = true # VTK norm of B , rho1 = 1.0 -alpha = 2.0 # ratio between prestrain parameters rho1 & rho2 +#alpha = 5.0 # ratio between prestrain parameters rho1 & rho2 +alpha = 2.0 # ratio between prestrain parameters rho1 & rho2 -theta = 0.25 +theta = 0.125 +#theta = 0.25 #theta = 0.3 # volume fraction #default = 1.0/4.0 #theta = 0.25 # volume fraction #theta = 0.75 # volume fraction -------------Matrix Material -------------- -#material_prestrain_imp ="matrix_material_circles" -#material_prestrain_imp ="matrix_material_squares" - -nF = 8 #number of Fibers (in each Layer) -#rF = 0.05 #Fiber radius max-fiber-radius = (width/(2.0*nF) ------------------------------------------- -width = 1.0 -height = 1.0 +material_prestrain_imp= "parametrized_Laminate" +#material_prestrain_imp= "analytical_Example" +#material_prestrain_imp ="isotropic_bilayer" +#material_prestrain_imp= "circle_fiber" #TEST +# -- write Material and/or prestrain functions: -############################################# -# Solver Type -############################################# -# 1: CG-Solver # 2: GMRES # 3: QR - -Solvertype = 1 - - - +#write_materialFunctions = true +#write_prestrainFunctions = true # VTK norm of B , -############################################# -# Define Analytic Solutions -############################################# -#b1 = (-(theta/4.0)*mu1*mu2)/(theta*mu1+(1.0-theta)*mu2) +# Prestrain Types: +#1 Isotropic Pressure +# Func2Tensor B1_ = [this] (const Domain& x) { // ISOTROPIC PRESSURE +# if (abs(x[0]) > (theta/2) && x[2] > 0) +# return MatrixRT{{p1, 0.0 , 0.0}, {0.0, p1, 0.0}, {0.0, 0.0, p1}}; +# if (abs(x[0]) < (theta/2) && x[2] < 0) +# return MatrixRT{{p2, 0.0 , 0.0}, {0.0, p2, 0.0}, {0.0, 0.0, p2}}; +# else +# return MatrixRT{{0.0, 0.0 , 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}}; +# }; +############################################# +# Assembly options +############################################# +set_IntegralZero = true +#set_IntegralZero = false -)*mu2) +#arbitraryLocalIndex = 7 +#arbitraryElementNumber = 3 +#arbitraryLocalIndex = 0 +#arbitraryElementNumber = 0 +############################################# +# Solver Type +Solvertype = 1 +#write_corrector_phi1 = false +#write_corrector_phi2 = false +#write_corrector_phi3 = false +#write_corrector_phi1 = true +#write_corrector_phi2 = true +#write_corrector_phi3 = true +write_L2Error = true +#write_IntegralMean = true +############################################# +# Define Analytic Solutions diff --git a/inputs/cellsolver_backup.parset b/inputs/cellsolver_backup.parset new file mode 100644 index 0000000000000000000000000000000000000000..2e5651ba3159c48648724dffc37b0315265aad12 --- /dev/null +++ b/inputs/cellsolver_backup.parset @@ -0,0 +1,151 @@ +# --- Parameter File as Input for 'Cell-Problem' +# +# NOTE: define variables without whitespaces in between! i.e. : gamma=1.0 instead of gamma = 1.0 +# since otherwise these cant be read from other Files! +# -------------------------------------------------------- + + + + +#path for logfile +#outputPath = "../../outputs/output.txt" + + +### Remove/Comment this when running via Python-Script: +outputPath = "../../outputs" + + + +#outputPath = "/home/klaus/Desktop/DUNE/dune-microstructure/outputs/output.txt" +#outputPath = "/home/klaus/Desktop/DUNE/dune-microstructure/outputs" + + +############################################# +# Cell Domain +############################################# +# Domain 1: (-1/2, 1/2)^3 , Domain 2 : [0,1)^2 x (-1/2, 1/2) + +cellDomain = 1 + +############################################# +# Grid parameters +############################################# + + +####################################################################### +## numLevels : Number of Levels on which solution is computed. starting with a 2x2x2 cube mesh. +## {start,finish} computes on all grid from 2^(start) to 2^finish refinement +######################################################################## + +#numLevels = 1 3 # computes all levels from first to second entry +numLevels = 3 3 # computes all levels from first to second entry +#numLevels = 1 6 + + +#Elements_Cell = 20 20 20 # number elements in each direction (y1 y2 x3) +#nElements_Cell = 30 30 30 +#nElements_Cell = 30 30 30 +#nElements_Cell = 50 50 50 +#nElements_Cell = 100 100 2 +#nElements_Cell = 100 100 100 // does not work +#nElements_Cell = 10 10 10 +#nElements_Cell = 2 2 2 +#nElements_Cell = 4 4 4 +#nElements_Cell = 8 8 8 +#nElements_Cell = 16 16 16 +#nElements_Cell = 32 32 32 +#nElements_Cell = 64 64 64 + + +#gamma=50.0 +gamma=1.0 +#gamma=2.5 + +############################################# +# Material parameters +############################################# +beta = 2.0 # ratio between material parameters mu1 & mu2 .... beta = 1.0 corresponds to homogeneous case + +mu1=1.0 +lambda1=0.0 +#lambda1 = 20.0 +#lambda1 = 20.0 +#lambda1 = 5.0 +#mu1=1000.0 + + +rho1 = 1.0 +#alpha = 5.0 # ratio between prestrain parameters rho1 & rho2 +alpha = 2.0 # ratio between prestrain parameters rho1 & rho2 + + +theta = 0.125 +#theta = 0.25 +#theta = 0.3 # volume fraction #default = 1.0/4.0 +#theta = 0.25 # volume fraction +#theta = 0.75 # volume fraction + +#### material_implementation("analytical_Example") ? + + + + +#material_prestrain_imp ="isotropic_bilayer" +#### material_implementation("analytical_Example") ? + +material_prestrain_imp= "analytical_Example" +#material_prestrain_imp ="isotropic_bilayer" + + +#material_prestrain_imp= "circle_fiber" #TEST +write_prestrainFunctions = true # VTK norm of B , + + + + + +# Prestrain Types: + +#1 Isotropic Pressure +# Func2Tensor B1_ = [this] (const Domain& x) { // ISOTROPIC PRESSURE +# if (abs(x[0]) > (theta/2) && x[2] > 0) +# return MatrixRT{{p1, 0.0 , 0.0}, {0.0, p1, 0.0}, {0.0, 0.0, p1}}; +# if (abs(x[0]) < (theta/2) && x[2] < 0) +# return MatrixRT{{p2, 0.0 , 0.0}, {0.0, p2, 0.0}, {0.0, 0.0, p2}}; +# else +# return MatrixRT{{0.0, 0.0 , 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}}; +# }; + + +############################################# +# Assembly options +############################################# + +set_IntegralZero = true +#set_IntegralZero = false + +#arbitraryLocalIndex = 7 +#arbitraryElementNumber = 3 + +#arbitraryLocalIndex = 0 +#arbitraryElementNumber = 0 + + +############################################# +# Solver Type + +Solvertype = 1 + +#write_corrector_phi1 = false +#write_corrector_phi2 = false +#write_corrector_phi3 = false +#write_corrector_phi1 = true +#write_corrector_phi2 = true +#write_corrector_phi3 = true + +write_L2Error = true +#write_IntegralMean = true + + +############################################# +# Define Analytic Solutions