diff --git a/dune/microstructure/EffectiveQuantitiesComputer.hh b/dune/microstructure/EffectiveQuantitiesComputer.hh index ddfad687a7ed29eda7c10af3495510b0349362b6..f2035a55b127769f34892bfba65639494ca3b439 100644 --- a/dune/microstructure/EffectiveQuantitiesComputer.hh +++ b/dune/microstructure/EffectiveQuantitiesComputer.hh @@ -206,7 +206,7 @@ public: // ----------------------------------------------------------------- // --- write Data to .Txt-File for Matlab / Optimization-Code - void writeToMatlab(std::string outputPath) + void writeEffectiveQuantitiesToTxt(std::string outputPath) { std::cout << "write effective quantities as .txt files to output folder..." << std::endl; writeMatrixToMatlab(Qeff_, outputPath + "/QMatrix.txt"); diff --git a/experiment/parametrized_laminate.py b/experiment/parametrized_laminate.py index 2ab334ccf21860d8b72bbcd9ff9f5a95d5e21b69..2b5de66030601a2ad82dc7a88549462e2b493ede 100644 --- a/experiment/parametrized_laminate.py +++ b/experiment/parametrized_laminate.py @@ -18,80 +18,16 @@ parameterSet.baseName= 'parametrized_laminate' #(needed for Output-Filename) ############################################# -#Parameters used: -theta = 0.25; -mu_1 = 1.0; -theta_mu = 2.0; -mu_2 = theta_mu * mu_1; -rho_1 = 1.0; -theta_rho = 2.0; -rho_2 = rho_1*theta_rho; - - - - -## Should be deprecated: - -# # --- Choose scale ratio gamma: -# parameterSet.gamma = 1.0 - -# # --- Number of material phases -# parameterSet.Phases = 4 - -# #--- Indicator function for material phases -# def indicatorFunction(x): -# theta=0.25 -# factor=1 -# if (abs(x[0]) < (theta/2) and x[2] < 0 ): -# return 1 #Phase1 -# elif (abs(x[0]) > (theta/2) and x[2] > 0 ): -# return 2 #Phase2 -# elif (abs(x[0]) < (theta/2) and x[2] > 0 ): -# return 3 #Phase3 -# else : -# return 4 #Phase4 - -# ########### 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 -# ###################################################################### - -# #--- Define different material phases: -# #- PHASE 1 -# parameterSet.phase1_type="isotropic" -# materialParameters_phase1 = [2.0, 0] - -# #- PHASE 2 -# parameterSet.phase2_type="isotropic" -# materialParameters_phase2 = [1.0, 0] - -# #- PHASE 3 -# parameterSet.phase3_type="isotropic" -# materialParameters_phase3 = [2.0, 0] - -# #- PHASE 4 -# parameterSet.phase4_type="isotropic" -# materialParameters_phase4 = [1.0, 0] - -# #--- 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]] - -# def prestrain_phase4(x): -# return [[0, 0, 0], [0,0,0], [0,0,0]] - +#Parameters used for analytical solutions: +# theta = 0.25; +# mu_1 = 1.0; +# theta_mu = 2.0; +# mu_2 = theta_mu * mu_1; +# rho_1 = 1.0; +# theta_rho = 2.0; +# rho_2 = rho_1*theta_rho; + class Microstructure: @@ -100,6 +36,16 @@ class Microstructure: self.gamma = 1.0 #in the future this might change depending on macroPoint. self.phases = 4 #in the future this might change depending on macroPoint. #--- Define different material phases: + + # ########### 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 + # ###################################################################### #- PHASE 1 self.phase1_type="isotropic" self.materialParameters_phase1 = [2.0, 0] @@ -167,10 +113,13 @@ parameterSet.Solver_verbosity = 0 #(default = 2) degree of information for sol # Write/Output options #(default=false) ############################################# # --- (Optional output) write Material / prestrain / Corrector functions to .vtk-Files: -parameterSet.write_materialFunctions = 0 # VTK indicator function for material/prestrain definition +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 + +parameterSet.write_EffectiveQuantitiesToTxt= True + # --- (Additional debug output) parameterSet.print_debug = 0 #(default=false) diff --git a/src/Cell-Problem.cc b/src/Cell-Problem.cc index f619cbc8cfd0d59d42e5af64ae35b09593c30961..68946e5526256a437a2ce22f5a1b3d168e144d4b 100644 --- a/src/Cell-Problem.cc +++ b/src/Cell-Problem.cc @@ -280,8 +280,8 @@ int main(int argc, char *argv[]) //--- Write effective quantities to matlab folder (for symbolic minimization) Dune::Timer txtOutputTimer; - if(parameterSet.get<bool>("write_toMATLAB", false)) - effectiveQuantitiesComputer.writeToMatlab(outputPath); + if(parameterSet.get<bool>("EffectiveQuantitiesToTxt", true)) + effectiveQuantitiesComputer.writeEffectiveQuantitiesToTxt(outputPath); std::cout << "Time to write effective quantities to .txt-files:" << txtOutputTimer.elapsed() << std::endl; diff --git a/src/micro-problem.cc b/src/micro-problem.cc index fe286f1c8005d8c6b97392b5dfe8615b37d59c7d..3e5b1fcef6e785053cbbd3cbdf9d650310a0c198 100644 --- a/src/micro-problem.cc +++ b/src/micro-problem.cc @@ -286,10 +286,9 @@ std::cout << "Number of Grid-Elements in each direction: " << (int)std::pow(2,mi //--- Write effective quantities to matlab folder (for symbolic minimization) - Dune::Timer txtOutputTimer; - if(parameterSet.get<bool>("write_toMATLAB", false)) - effectiveQuantitiesComputer.writeToMatlab(outputPath); - std::cout << "Time to write effective quantities to .txt-files:" << txtOutputTimer.elapsed() << std::endl; + if(parameterSet.get<bool>("write_EffectiveQuantitiesToTxt", true)) + effectiveQuantitiesComputer.writeEffectiveQuantitiesToTxt(outputPath); +