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

Add absolute OutputPath

parent e52e2235
No related branches found
No related tags found
No related merge requests found
#path for logfile #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 ...@@ -30,7 +31,7 @@ cellDomain = 1
######################################################################## ########################################################################
#numLevels = 1 3 # computes all levels from first to second entry #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 #numLevels = 1 6
...@@ -52,8 +53,9 @@ numLevels = 3 3 # computes all levels from first to second entry ...@@ -52,8 +53,9 @@ numLevels = 3 3 # computes all levels from first to second entry
#nElements_Cell = 64 64 64 #nElements_Cell = 64 64 64
#gamma = 50.0 #gamma=50.0
gamma = 1.0 #gamma=1.0
gamma=51.0
############################################# #############################################
# Material parameters # Material parameters
...@@ -64,15 +66,16 @@ write_materialFunctions = true # VTK mu-functions , lambda-functions ...@@ -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 beta = 2.0 # ratio between material parameters mu1 & mu2 .... beta = 1.0 corresponds to homogeneous case
mu1 = 10.0 mu1 = 10.0
lambda1 = 20.0 lambda1 = 0.0
#lambda1 = 20.0
#lambda1 = 20.0 #lambda1 = 20.0
#lambda1 = 5.0 #lambda1 = 5.0
#material_implementation = "analytical_Example" material_implementation = "analytical_Example"
#material_implementation = "isotropic_bilayer" #material_implementation = "isotropic_bilayer"
#material_implementation = "matrix_material_circles" #material_implementation = "matrix_material_circles"
material_implementation = "matrix_material_squares" #material_implementation = "matrix_material_squares"
#material_implementation = "circle_fiber" #TEST #material_implementation = "circle_fiber" #TEST
#material_implementation = "square_fiber" #TEST #material_implementation = "square_fiber" #TEST
...@@ -81,6 +84,8 @@ material_implementation = "matrix_material_squares" ...@@ -81,6 +84,8 @@ material_implementation = "matrix_material_squares"
# Prestrain parameters # Prestrain parameters
############################################# #############################################
write_prestrainFunctions = true # VTK norm of B ,
rho1 = 1.0 rho1 = 1.0
alpha = 5.0 # ratio between prestrain parameters rho1 & rho2 alpha = 5.0 # ratio between prestrain parameters rho1 & rho2
...@@ -88,13 +93,13 @@ 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.25 # volume fraction
#theta = 0.75 # volume fraction #theta = 0.75 # volume fraction
#prestrainType = "analytical_Example" prestrainType = "analytical_Example"
#prestrainType = "isotropic_bilayer" #prestrainType = "isotropic_bilayer"
------------Matrix Material -------------- ------------Matrix Material --------------
#prestrainType = "matrix_material_circles" #prestrainType = "matrix_material_circles"
prestrainType = "matrix_material_squares" #prestrainType = "matrix_material_squares"
nF = 8 #number of Fibers (in each Layer) nF = 8 #number of Fibers (in each Layer)
#rF = 0.05 #Fiber radius max-fiber-radius = (width/(2.0*nF) #rF = 0.05 #Fiber radius max-fiber-radius = (width/(2.0*nF)
......
...@@ -723,10 +723,14 @@ double computeL2SymError(const Basis& basis, ...@@ -723,10 +723,14 @@ double computeL2SymError(const Basis& basis,
const MatrixFunction& matrixFieldFunc) const MatrixFunction& matrixFieldFunc)
{ {
double error = 0.0; double error = 0.0;
constexpr int dim = 3;
constexpr int dimWorld = 3;
auto localView = basis.localView(); 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 matrixFieldGVF = Dune::Functions::makeGridViewFunction(matrixFieldFunc, basis.gridView());
auto matrixField = localFunction(matrixFieldGVF); auto matrixField = localFunction(matrixFieldGVF);
using MatrixRT = FieldMatrix< double, dimWorld, dimWorld>; using MatrixRT = FieldMatrix< double, dimWorld, dimWorld>;
...@@ -764,14 +768,14 @@ double computeL2SymError(const Basis& basis, ...@@ -764,14 +768,14 @@ double computeL2SymError(const Basis& basis,
for (size_t k=0; k < dimWorld; k++) for (size_t k=0; k < dimWorld; k++)
for (size_t i=0; i < nSf; i++) for (size_t i=0; i < nSf; i++)
{ {
size_t localIdx1 = localView.tree().child(k).localIndex(i); // hier i:leafIdx size_t localIdx = localView.tree().child(k).localIndex(i); // hier i:leafIdx
size_t globalIdx1 = localView.index(localIdx1); size_t globalIdx = localView.index(localIdx);
// (scaled) Deformation gradient of the ansatz basis function // (scaled) Deformation gradient of the ansatz basis function
MatrixRT defGradientU(0); MatrixRT defGradientU(0);
defGradientU[k][0] = coeffVector[globalIdx1]*gradients[i][0]; // Y //hier i:leafIdx defGradientU[k][0] = coeffVector[globalIdx]*gradients[i][0]; // Y //hier i:leafIdx
defGradientU[k][1] = coeffVector[globalIdx1]*gradients[i][1]; //X2 defGradientU[k][1] = coeffVector[globalIdx]*gradients[i][1]; //X2
defGradientU[k][2] = coeffVector[globalIdx1]*(1.0/gamma)*gradients[i][2]; //X3 defGradientU[k][2] = coeffVector[globalIdx]*(1.0/gamma)*gradients[i][2]; //X3
tmp += sym(defGradientU); tmp += sym(defGradientU);
} }
...@@ -843,7 +847,9 @@ int main(int argc, char *argv[]) ...@@ -843,7 +847,9 @@ int main(int argc, char *argv[])
} }
// Output setter // 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; std::fstream log;
log.open(outputPath ,std::ios::out); log.open(outputPath ,std::ios::out);
...@@ -853,7 +859,7 @@ int main(int argc, char *argv[]) ...@@ -853,7 +859,7 @@ int main(int argc, char *argv[])
/////////////////////////////////// ///////////////////////////////////
// Get Parameters/Data // 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 alpha = parameterSet.get<double>("alpha", 2.0);
double theta = parameterSet.get<double>("theta",1.0/4.0); double theta = parameterSet.get<double>("theta",1.0/4.0);
/////////////////////////////////// ///////////////////////////////////
...@@ -888,6 +894,7 @@ int main(int argc, char *argv[]) ...@@ -888,6 +894,7 @@ int main(int argc, char *argv[])
// log << "prestrain imp: " << prestraintype << "\nrho1 = " << rho1 << "\nrho2 = " << rho2 << std::endl; // log << "prestrain imp: " << prestraintype << "\nrho1 = " << rho1 << "\nrho2 = " << rho2 << std::endl;
log << "alpha: " << alpha << std::endl; log << "alpha: " << alpha << std::endl;
log << "OUTPUT GAMMA-----: " << std::endl;
log << "gamma: " << gamma << std::endl; log << "gamma: " << gamma << std::endl;
log << "theta: " << theta << std::endl; log << "theta: " << theta << std::endl;
log << "beta: " << beta << std::endl; log << "beta: " << beta << std::endl;
...@@ -1431,6 +1438,15 @@ int main(int argc, char *argv[]) ...@@ -1431,6 +1438,15 @@ int main(int argc, char *argv[])
double q1 = ((mu1*mu2)/6.0)/(theta*mu1+ (1.0- theta)*mu2); double q1 = ((mu1*mu2)/6.0)/(theta*mu1+ (1.0- theta)*mu2);
double q2 = ((1.0-theta)*mu1+theta*mu2)/6.0; 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 << " --- print analytic solutions --- " << std::endl;
std::cout << "b1_hat : " << b1_hat << std::endl; std::cout << "b1_hat : " << b1_hat << std::endl;
...@@ -1491,6 +1507,8 @@ int main(int argc, char *argv[]) ...@@ -1491,6 +1507,8 @@ int main(int argc, char *argv[])
std::cout << "L2Norm(phi_1): " << L2Norm << std::endl; std::cout << "L2Norm(phi_1): " << L2Norm << std::endl;
std::cout << " -----------------" << std::endl; std::cout << " -----------------" << std::endl;
log << "L2-Error (symmetric Gradient phi_1):" << L2SymError << std::endl; log << "L2-Error (symmetric Gradient phi_1):" << L2SymError << std::endl;
log << "L2-Norm(Symphi_1): " << L2Norm_Symphi<< std::endl; log << "L2-Norm(Symphi_1): " << L2Norm_Symphi<< std::endl;
log << "L2-Norm(SymAnalytic): " << L2Norm_SymAnalytic << std::endl; log << "L2-Norm(SymAnalytic): " << L2Norm_SymAnalytic << std::endl;
...@@ -1689,7 +1707,8 @@ int main(int argc, char *argv[]) ...@@ -1689,7 +1707,8 @@ int main(int argc, char *argv[])
log << std::endl; log << std::endl;
} }
} }
log << "OUTPUT GAMMA-----: " << std::endl;
log << "gamma: " << gamma << std::endl;
log.close(); log.close();
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment