diff --git a/inputs/cellsolver.parset b/inputs/cellsolver.parset index af1a896487fe963ffc3da5c49b7bc25c9939b6e0..42b9e10fe0b1121156c4be9fea1fd07994dd123f 100644 --- a/inputs/cellsolver.parset +++ b/inputs/cellsolver.parset @@ -1,7 +1,8 @@ #path for logfile -outputPath = "../../outputs/output.txt" +#outputPath = "../../outputs/output.txt" +outputPath = "/home/klaus/Desktop/DUNE/dune-microstructure/outputs/output.txt" ############################################# @@ -30,7 +31,7 @@ cellDomain = 1 ######################################################################## #numLevels = 1 3 # computes all levels from first to second entry -numLevels = 3 3 # computes all levels from first to second entry +numLevels = 2 2 # computes all levels from first to second entry #numLevels = 1 6 @@ -52,8 +53,9 @@ numLevels = 3 3 # computes all levels from first to second entry #nElements_Cell = 64 64 64 -#gamma = 50.0 -gamma = 1.0 +#gamma=50.0 +#gamma=1.0 +gamma=51.0 ############################################# # Material parameters @@ -64,15 +66,16 @@ 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 -lambda1 = 20.0 +lambda1 = 0.0 +#lambda1 = 20.0 #lambda1 = 20.0 #lambda1 = 5.0 -#material_implementation = "analytical_Example" +material_implementation = "analytical_Example" #material_implementation = "isotropic_bilayer" #material_implementation = "matrix_material_circles" -material_implementation = "matrix_material_squares" +#material_implementation = "matrix_material_squares" #material_implementation = "circle_fiber" #TEST #material_implementation = "square_fiber" #TEST @@ -81,6 +84,8 @@ material_implementation = "matrix_material_squares" # Prestrain parameters ############################################# +write_prestrainFunctions = true # VTK norm of B , + rho1 = 1.0 alpha = 5.0 # ratio between prestrain parameters rho1 & rho2 @@ -88,13 +93,13 @@ alpha = 5.0 # ratio between prestrain parameters rho1 & rho2 #theta = 0.25 # volume fraction #theta = 0.75 # volume fraction -#prestrainType = "analytical_Example" +prestrainType = "analytical_Example" #prestrainType = "isotropic_bilayer" ------------Matrix Material -------------- #prestrainType = "matrix_material_circles" -prestrainType = "matrix_material_squares" +#prestrainType = "matrix_material_squares" nF = 8 #number of Fibers (in each Layer) #rF = 0.05 #Fiber radius max-fiber-radius = (width/(2.0*nF) diff --git a/src/dune-microstructure.cc b/src/dune-microstructure.cc index 80d292950162b649d883a1703caa84938441d6e1..1a670643ad589c8834288ff070c2892f4aa4a909 100644 --- a/src/dune-microstructure.cc +++ b/src/dune-microstructure.cc @@ -723,10 +723,14 @@ double computeL2SymError(const Basis& basis, const MatrixFunction& matrixFieldFunc) { double error = 0.0; - constexpr int dim = 3; - constexpr int dimWorld = 3; + auto localView = basis.localView(); + + // constexpr int dim = 3; + constexpr int dim = Basis::LocalView::Element::dimension; //TODO TEST + constexpr int dimWorld = 3; // Hier auch möglich? + auto matrixFieldGVF = Dune::Functions::makeGridViewFunction(matrixFieldFunc, basis.gridView()); auto matrixField = localFunction(matrixFieldGVF); using MatrixRT = FieldMatrix< double, dimWorld, dimWorld>; @@ -764,14 +768,14 @@ double computeL2SymError(const Basis& basis, for (size_t k=0; k < dimWorld; k++) for (size_t i=0; i < nSf; i++) { - size_t localIdx1 = localView.tree().child(k).localIndex(i); // hier i:leafIdx - size_t globalIdx1 = localView.index(localIdx1); + size_t localIdx = localView.tree().child(k).localIndex(i); // hier i:leafIdx + size_t globalIdx = localView.index(localIdx); // (scaled) Deformation gradient of the ansatz basis function MatrixRT defGradientU(0); - defGradientU[k][0] = coeffVector[globalIdx1]*gradients[i][0]; // Y //hier i:leafIdx - defGradientU[k][1] = coeffVector[globalIdx1]*gradients[i][1]; //X2 - defGradientU[k][2] = coeffVector[globalIdx1]*(1.0/gamma)*gradients[i][2]; //X3 + defGradientU[k][0] = coeffVector[globalIdx]*gradients[i][0]; // Y //hier i:leafIdx + defGradientU[k][1] = coeffVector[globalIdx]*gradients[i][1]; //X2 + defGradientU[k][2] = coeffVector[globalIdx]*(1.0/gamma)*gradients[i][2]; //X3 tmp += sym(defGradientU); } @@ -843,7 +847,9 @@ int main(int argc, char *argv[]) } // Output setter - std::string outputPath = parameterSet.get("outputPath", "../../outputs/output.txt"); +// std::string outputPath = parameterSet.get("outputPath", "../../outputs/output.txt"); + std::string outputPath = parameterSet.get("outputPath", "/home/klaus/Desktop/DUNE/dune-microstructure/outputs/output.txt"); +// std::string outputPath = "/home/klaus/Desktop/DUNE/dune-microstructure/outputs/output.txt"; std::fstream log; log.open(outputPath ,std::ios::out); @@ -853,7 +859,7 @@ int main(int argc, char *argv[]) /////////////////////////////////// // Get Parameters/Data /////////////////////////////////// - double gamma = parameterSet.get<double>("gamma",1.0); // ratio dimension reduction to homogenization + double gamma = parameterSet.get<double>("gamma",3.0); // ratio dimension reduction to homogenization double alpha = parameterSet.get<double>("alpha", 2.0); double theta = parameterSet.get<double>("theta",1.0/4.0); /////////////////////////////////// @@ -888,6 +894,7 @@ int main(int argc, char *argv[]) // log << "prestrain imp: " << prestraintype << "\nrho1 = " << rho1 << "\nrho2 = " << rho2 << std::endl; log << "alpha: " << alpha << std::endl; + log << "OUTPUT GAMMA-----: " << std::endl; log << "gamma: " << gamma << std::endl; log << "theta: " << theta << std::endl; log << "beta: " << beta << std::endl; @@ -1431,6 +1438,15 @@ int main(int argc, char *argv[]) double q1 = ((mu1*mu2)/6.0)/(theta*mu1+ (1.0- theta)*mu2); double q2 = ((1.0-theta)*mu1+theta*mu2)/6.0; + + + + std::cout << "Test B_hat & B_eff" << std::endl; + double p1 = parameterSet.get<double>("rho1", 1.0); + double alpha = parameterSet.get<double>("alpha", 2.0); + double p2 = alpha*p1; + + std::cout << ((3.0*p1)/2.0)*beta*(1-(theta*(1+alpha))) << std::endl; // TODO ERROR in paper ?? std::cout << " --- print analytic solutions --- " << std::endl; std::cout << "b1_hat : " << b1_hat << std::endl; @@ -1491,6 +1507,8 @@ int main(int argc, char *argv[]) std::cout << "L2Norm(phi_1): " << L2Norm << std::endl; std::cout << " -----------------" << std::endl; + + log << "L2-Error (symmetric Gradient phi_1):" << L2SymError << std::endl; log << "L2-Norm(Symphi_1): " << L2Norm_Symphi<< std::endl; log << "L2-Norm(SymAnalytic): " << L2Norm_SymAnalytic << std::endl; @@ -1689,7 +1707,8 @@ int main(int argc, char *argv[]) log << std::endl; } } - + log << "OUTPUT GAMMA-----: " << std::endl; + log << "gamma: " << gamma << std::endl; log.close(); }