Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-tectonic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
podlesny
dune-tectonic
Commits
06694700
Commit
06694700
authored
5 years ago
by
podlesny
Browse files
Options
Downloads
Patches
Plain Diff
.
parent
2e41bbd4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/multi-body-problem.cc
+10
-119
10 additions, 119 deletions
src/multi-body-problem.cc
with
10 additions
and
119 deletions
src/multi-body-problem.cc
+
10
−
119
View file @
06694700
...
@@ -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());
// -----------------
// -----------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment