Skip to content
Snippets Groups Projects
Commit 06694700 authored by podlesny's avatar podlesny
Browse files

.

parent 2e41bbd4
No related branches found
No related tags found
No related merge requests found
...@@ -87,34 +87,6 @@ ...@@ -87,34 +87,6 @@
size_t const dims = MY_DIM; 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 getParameters(int argc, char *argv[]) {
Dune::ParameterTree parset; Dune::ParameterTree parset;
Dune::ParameterTreeParser::readINITree("/home/mi/podlesny/software/dune/dune-tectonic/src/multi-body-problem.cfg", 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[]) { ...@@ -161,112 +133,31 @@ int main(int argc, char *argv[]) {
threeBlocksFactory.build(); threeBlocksFactory.build();
ContactNetwork& contactNetwork = threeBlocksFactory.contactNetwork(); */ ContactNetwork& contactNetwork = threeBlocksFactory.contactNetwork(); */
const size_t bodyCount = contactNetwork.nBodies(); const size_t bodyCount = contactNetwork.nBodies();
/*
for (size_t i=0; i<bodyCount; i++) { for (size_t i=0; i<bodyCount; i++) {
// printDofLocation(contactNetwork.body(i)->gridView()); // printDofLocation(contactNetwork.body(i)->gridView());
/* Vector def(contactNetwork.deformedGrids()[i]->size(dims));
def = 1; //Vector def(contactNetwork.deformedGrids()[i]->size(dims));
deformedGridComplex.setDeformation(def, i);*/ //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++) { for (size_t j=0; j<levelViews.size(); j++) {
writeToVTK(*levelViews[j], "", "body_" + std::to_string(i) + "_level_" + std::to_string(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 // assemble contactNetwork
// ---------------------------- // ----------------------------
contactNetwork.assemble(); 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()); //printMortarBasis<Vector>(contactNetwork.nBodyAssembler());
// ----------------- // -----------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment