From 0f554a5afacffe4773c09276ee808581316780dc Mon Sep 17 00:00:00 2001 From: Klaus <klaus.boehnlein@tu-dresden.de> Date: Fri, 6 Aug 2021 22:24:52 +0200 Subject: [PATCH] Update --- inputs/cellsolver.parset | 9 ++++++--- src/dune-microstructure.cc | 18 ++++++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/inputs/cellsolver.parset b/inputs/cellsolver.parset index dd89c510..16a7832c 100644 --- a/inputs/cellsolver.parset +++ b/inputs/cellsolver.parset @@ -25,15 +25,18 @@ levels = 2 #nElements_Cell = 100 100 100 // does not work #nElements_Cell = 10 10 10 -#nElements_Cell = 4 4 4 +#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 = 32 32 32 +#nElements_Cell = 64 64 64 width = 1.0 -gamma = 1.0 +gamma = 50.0 +#gamma = 1.0 ############################################# # Material parameters diff --git a/src/dune-microstructure.cc b/src/dune-microstructure.cc index 34e48b38..2d9dd9d7 100644 --- a/src/dune-microstructure.cc +++ b/src/dune-microstructure.cc @@ -784,7 +784,7 @@ auto energy(const Basis& basis, auto geometry = e.geometry(); const auto& localFiniteElement = localView.tree().child(0).finiteElement(); -// int orderQR = 2*(dim*localFiniteElement.localBasis().order()-1)+3; // TEST +// int orderQR = 2*(dim*localFiniteElement.localBasis().order()-1 + 5 ); // TEST int orderQR = 2*(dim*localFiniteElement.localBasis().order()-1); const QuadratureRule<double, dim>& quad = QuadratureRules<double, dim>::rule(e.type(), orderQR); @@ -1038,7 +1038,8 @@ double computeL2SymErrorNew(const Basis& basis, const auto& localFiniteElement = localView.tree().child(0).finiteElement(); // Unterscheidung children notwendig? const auto nSf = localFiniteElement.localBasis().size(); // std::cout << "print nSf:" << nSf << std::endl; - int orderQR = 2*(dim*localFiniteElement.localBasis().order()-1); +// int orderQR = 2*(dim*localFiniteElement.localBasis().order()-1 + 5 ); //TEST + int orderQR = 2*(dim*localFiniteElement.localBasis().order()-1 ); //TEST const auto& quad = QuadratureRules<double,dim>::rule(element.type(), orderQR); @@ -2152,7 +2153,7 @@ int main(int argc, char *argv[]) /////////////////////////////////// // Get Parameters/Data /////////////////////////////////// - double gamma = parameterSet.get<double>("gamma",2000.0); // ratio dimension reduction to homogenization + double gamma = parameterSet.get<double>("gamma",1.0); // ratio dimension reduction to homogenization // Plate geometry settings double width = parameterSet.get<double>("width", 1.0); //geometry cell, cross section @@ -2237,7 +2238,7 @@ int main(int argc, char *argv[]) // Create Lambda-Functions for material Parameters depending on microstructure /////////////////////////////////// auto muTerm = [mu1, mu2, theta] (const Domain& z) { - if (abs(z[0]) >= (theta/2.0)) //TODO check ..nullset/boundary + if (abs(z[0]) >= (theta/2.0)) //TODO check ..nullset/boundary return mu1; // if (abs(z[0]) > (theta/2.0)) //TEST include boundary (indicatorFunction) // return mu1; @@ -2742,6 +2743,7 @@ int main(int argc, char *argv[]) std::cout<< "q2_c: " << q2_c << std::endl; std::cout<< "q3_c: " << q3_c << std::endl; std::cout << "Gamma: " << gamma << std::endl; + std::cout << "Number of Elements in each direction: " << nElements << std::endl; log << "computed q1: " << q1_c << std::endl; log << "computed q2: " << q2_c << std::endl; log << "computed q3: " << q3_c << std::endl; @@ -2830,6 +2832,14 @@ int main(int argc, char *argv[]) std::cout << "L2ErrorOld:" << computeL2ErrorOld(Basis_CE,phi_1,gamma,symPhi_1_analytic) << std::endl; } + + ////////////////////////////////////////////////////////////////////////////////////////////// + // Write Data for Matlab / Optimization + ////////////////////////////////////////////////////////////////////////////////////////////// + + + writeMatrixToMatlab(Q, "matlab.txt"); + ////////////////////////////////////////////////////////////////////////////////////////////// // Write result to VTK file ////////////////////////////////////////////////////////////////////////////////////////////// -- GitLab