From 06694700a1c3d7224f494a962ece6bfe582f6f6d Mon Sep 17 00:00:00 2001 From: podlesny <podlesny@mi.fu-berlin.de> Date: Mon, 15 Jul 2019 15:32:38 +0200 Subject: [PATCH] . --- src/multi-body-problem.cc | 129 +++----------------------------------- 1 file changed, 10 insertions(+), 119 deletions(-) diff --git a/src/multi-body-problem.cc b/src/multi-body-problem.cc index f7ef93e5..6e32d93b 100644 --- a/src/multi-body-problem.cc +++ b/src/multi-body-problem.cc @@ -87,34 +87,6 @@ size_t const dims = MY_DIM; -template <class SupportPatchFactory> -void testSuite(const SupportPatchFactory& supportPatchFactory, const size_t bodyID, const int patchDepth = 0) { -/* const auto& coarseContactNetwork = supportPatchFactory.coarseContactNetwork(); - const auto& gridView = coarseContactNetwork.body(bodyID)->gridView(); - - for (const auto& e : elements(gridView)) { - - } - - using Patch = typename SupportPatchFactory::Patch; - Patch patch0, patch1, patch2, patch3; - - // (const size_t bodyID, const Element& coarseElement, const size_t localVertex, Patch& patchDofs, const int patchDepth = 0) - - // interior patch inside of one body - supportPatchFactory.build(0, const Element& coarseElement, const size_t localVertex, patch0, patchDepth); - - // patch at friction interface with two bodies in contact - supportPatchFactory.build(0, const Element& coarseElement, const size_t localVertex, patch1 patchDepth); - - // patch at friction interface with two bodies in contact and with dirichlet boundary - supportPatchFactory.build(0, const Element& coarseElement, const size_t localVertex, patch2, patchDepth); - - // crosspoint patch, where all 3 bodies are in contact - supportPatchFactory.build(0, const Element& coarseElement, const size_t localVertex, patch3, patchDepth);*/ -} - - Dune::ParameterTree getParameters(int argc, char *argv[]) { Dune::ParameterTree parset; Dune::ParameterTreeParser::readINITree("/home/mi/podlesny/software/dune/dune-tectonic/src/multi-body-problem.cfg", parset); @@ -161,112 +133,31 @@ int main(int argc, char *argv[]) { threeBlocksFactory.build(); ContactNetwork& contactNetwork = threeBlocksFactory.contactNetwork(); */ + const size_t bodyCount = contactNetwork.nBodies(); + /* for (size_t i=0; i<bodyCount; i++) { - // printDofLocation(contactNetwork.body(i)->gridView()); - /* Vector def(contactNetwork.deformedGrids()[i]->size(dims)); - def = 1; - deformedGridComplex.setDeformation(def, i);*/ + // printDofLocation(contactNetwork.body(i)->gridView()); + + //Vector def(contactNetwork.deformedGrids()[i]->size(dims)); + //def = 1; + //deformedGridComplex.setDeformation(def, i); - /*auto& levelViews = contactNetwork.levelViews(i); + auto& levelViews = contactNetwork.levelViews(i); for (size_t j=0; j<levelViews.size(); j++) { writeToVTK(*levelViews[j], "", "body_" + std::to_string(i) + "_level_" + std::to_string(j)); } - writeToVTK(contactNetwork.leafView(i), "", "body_" + std::to_string(i) + "_leaf"); */ - } + writeToVTK(contactNetwork.leafView(i), "", "body_" + std::to_string(i) + "_leaf"); + } */ // ---------------------------- // assemble contactNetwork // ---------------------------- contactNetwork.assemble(); - /* std::vector<Vector> def(bodyCount); - for (size_t i=0; i<bodyCount; i++) { - def[i].resize(contactNetwork.body(i)->nVertices()); - def[i] = 1; - } - contactNetwork.setDeformation(def);*/ - - /* const auto & coarseContactNetwork = *contactNetwork.level(3); - const auto & fineContactNetwork = *contactNetwork.level(4); - // SupportPatchFactory<typename ContactNetwork::LevelContactNetwork> supportPatchFactory(coarseContactNetwork, fineContactNetwork); - size_t bodyID = 2; - size_t patchDepth = 3; - - std::cout << std::endl; - - // print coarse dofs - for (size_t i=0; i<bodyCount; i++) { - std::cout << "Coarse dofs body " << i << std::endl; - const auto& gv = coarseContactNetwork.body(i)->gridView(); - printDofLocation(gv); - - ScalarVector dofs(gv.size(dims)); - for (size_t j=0; j<dofs.size(); j++) { - dofs[j] = j; - } - writeToVTK(gv, dofs, "", "body_" + std::to_string(i) + "_coarse"); - } - - // print fine dofs - for (size_t i=0; i<bodyCount; i++) { - std::cout << "Fine dofs body " << i << std::endl; - const auto& gv = fineContactNetwork.body(i)->gridView(); - printDofLocation(gv); - - ScalarVector dofs(gv.size(dims)); - for (size_t j=0; j<dofs.size(); j++) { - dofs[j] = j; - } - writeToVTK(gv, dofs, "", "body_" + std::to_string(i) + "_fine"); - } */ - - /* - using Patch = typename SupportPatchFactory<typename ContactNetwork::LevelContactNetwork>::Patch; - Patch patch; - - const auto& gridView = coarseContactNetwork.body(bodyID)->gridView(); - - Dune::PQkLocalFiniteElementCache<double, double, dims, 1> cache; - Dune::BitSetVector<1> vertexVisited(gridView.size(dims)); - vertexVisited.unsetAll(); - - for (const auto& e: elements(gridView)) { - const auto& refElement = Dune::ReferenceElements<double, dims>::general(e.type()); - - for (size_t i=0; i<refElement.size(dims); i++) { - auto localIdx = cache.get(e.type()).localCoefficients().localKey(i).subEntity(); - auto globalIdx = gridView.indexSet().subIndex(e, i, dims); - - if (!vertexVisited[globalIdx][0]) { - vertexVisited[globalIdx][0] = true; - supportPatchFactory.build(bodyID, e, i, patch, patchDepth); - - print(patch, "patch:"); - - size_t c = 0; - for (size_t j=0; j<bodyCount; j++) { - const auto& gv = fineContactNetwork.body(j)->gridView(); - - ScalarVector patchVec(gv.size(dims)); - for (size_t l=0; l<patchVec.size(); l++) { - if (patch[c++][0]) { - patchVec[l][0] = 1; - } - } - - print(patchVec, "patchVec"); - - // output patch - writeToVTK(gv, patchVec, "", "patch_" + std::to_string(globalIdx) + "_body_" + std::to_string(j)); - } - } - } - } */ - //printMortarBasis<Vector>(contactNetwork.nBodyAssembler()); // ----------------- -- GitLab