diff --git a/src/dune-microstructure.cc b/src/dune-microstructure.cc index 2dc0af1c0a6048ed3686268669d09cb5c27e491d..877b81367e6fe58be765f31cc6e34bfeac396d4b 100644 --- a/src/dune-microstructure.cc +++ b/src/dune-microstructure.cc @@ -397,12 +397,42 @@ void getOccupationPattern(const Basis& basis, MatrixIndexSet& nb) } ////////////////////////////////////////////////////////////////// - // setIntegralZero: + // setIntegralZero: + ////////////////////////////////////////////////////////////////// int arbitraryIndex = 0; FieldVector<int,3> row; unsigned int elementCounter = 1; +// for (const auto& element : elements(basis.gridView())) +// { +// localView.bind(element); +// +// if(elementCounter == 1) // get arbitraryIndex(global) for each Component ..alternativ:gridView.indexSet +// { +// for (int k = 0; k < 3; k++) +// { +// auto rowLocal = localView.tree().child(k).localIndex(arbitraryIndex); +// row[k] = localView.index(rowLocal); +// } +// } +// +// // "global assembly" +// for (int k = 0; k<3; k++) +// for (size_t j=0; j<localView.size(); j++) +// { +// auto col = localView.index(j); +// nb.add(row[k],col); +// } +// elementCounter++; +// } + ///////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////// + // setOneBaseFunctionToZero necessary? //TODO besser: if(parameterSet_.get<bool>("set_one_base_function_to_0" )){ + + //Determine 3 global indices (one for each component of an arbitrary FE-function).. oder mittels Offset? + // use first element: for (const auto& element : elements(basis.gridView())) { localView.bind(element); @@ -418,39 +448,10 @@ void getOccupationPattern(const Basis& basis, MatrixIndexSet& nb) // "global assembly" for (int k = 0; k<3; k++) - for (size_t j=0; j<localView.size(); j++) - { - auto col = localView.index(j); - nb.add(row[k],col); - } + nb.add(row[k],row[k]); + elementCounter++; } - ///////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////// - // setOneBaseFunctionToZero necessary? - - //Determine 3 global indices (one for each component of an arbitrary FE-function).. oder mittels Offset? - // use first element: - // auto it = basis.gridView().template begin<0>(); - // localView.bind(*it); - // - // int arbitraryIndex = 0; - // FieldVector<int,3> row; //fill with Indices.. - // - // - // for (int k = 0; k < 3; k++) - // { - // auto rowLocal = localView.tree().child(k).localIndex(arbitraryIndex); - // row[k] = localView.index(rowLocal); - // auto cIt = stiffnessMatrix[row[k]].begin(); - // auto cEndIt = stiffnessMatrix[row[k]].end(); - // for (; cIt!=cEndIt; ++cIt) - // *cIt = (cIt.index()==row[k]) ? 1.0 : 0.0; - // } - - - } @@ -1199,14 +1200,6 @@ auto subtractIntegralMean(const Basis& basis, - - -// ---- TODO - MatrixEmbedding function (iota) ---- ? - - - - - // Check whether two points are equal on R/Z x R/Z x R auto equivalent = [](const FieldVector<double,3>& x, const FieldVector<double,3>& y) { @@ -1222,6 +1215,14 @@ auto equivalent = [](const FieldVector<double,3>& x, const FieldVector<double,3> +// ---- TODO - MatrixEmbedding function (iota) ---- ? + + + + + + + @@ -1262,7 +1263,7 @@ int main(int argc, char *argv[]) // Get Parameters/Data /////////////////////////////////// - double gamma = parameterSet.get<double>("gamma",5); // ratio dimension reduction to homogenization + double gamma = parameterSet.get<double>("gamma",2); // ratio dimension reduction to homogenization // Material parameter laminat // double E1 = parameterSet.get<double>("E1", 17e6); //material1 @@ -1461,10 +1462,11 @@ int main(int argc, char *argv[]) // bool set_integral_zero = true; + bool set_oneBasisFunction_Zero = true; bool substract_integralMean = true; - // bool set_oneBasisFunction_Zero = false; - // bool substract_integralMean = false; +// bool set_oneBasisFunction_Zero = false; +// bool substract_integralMean = false; @@ -1783,6 +1785,8 @@ int main(int argc, char *argv[]) auto GGterm = energy(Basis_CE, muLocal, lambdaLocal, x3MatrixBasis[a] , x3MatrixBasis[b] ); // <L i(x3G_alpha) , i(x3G_beta) > Q[a][b] = coeffContainer[a]*tmp1 + GGterm; // seems symmetric... check positiv definitness? + std::cout << "GGTerm:" << GGterm << std::endl; + std::cout << "coeff*tmp: " << coeffContainer[a]*tmp1 << std::endl; } } printmatrix(std::cout, Q, "Matrix Q", "--");