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

.

parent 04181c88
No related branches found
No related tags found
No related merge requests found
...@@ -8,9 +8,15 @@ template <class Matrix> class Matrices { ...@@ -8,9 +8,15 @@ template <class Matrix> class Matrices {
std::vector<std::shared_ptr<Matrix>> mass; std::vector<std::shared_ptr<Matrix>> mass;
Matrices(size_t n) { Matrices(size_t n) {
elasticity.resize(n); elasticity.resize(n);
damping.resize(n); damping.resize(n);
mass.resize(n); mass.resize(n);
for (size_t i=0; i<n; i++) {
elasticity[i] = std::make_shared<Matrix>();
damping[i] = std::make_shared<Matrix>();
mass[i] = std::make_shared<Matrix>();
}
} }
}; };
#endif #endif
...@@ -237,6 +237,8 @@ int main(int argc, char *argv[]) { ...@@ -237,6 +237,8 @@ int main(int argc, char *argv[]) {
std::vector<std::shared_ptr<CouplingPair>> couplings(bodyCount-1); std::vector<std::shared_ptr<CouplingPair>> couplings(bodyCount-1);
for (size_t i=0; i<couplings.size(); i++) { for (size_t i=0; i<couplings.size(); i++) {
couplings[i] = std::make_shared<CouplingPair>();
auto nonmortarPatch = std::make_shared<LevelBoundaryPatch>(levelFaces[i]->upper); auto nonmortarPatch = std::make_shared<LevelBoundaryPatch>(levelFaces[i]->upper);
auto mortarPatch = std::make_shared<LevelBoundaryPatch>(levelFaces[i+1]->lower); auto mortarPatch = std::make_shared<LevelBoundaryPatch>(levelFaces[i+1]->lower);
...@@ -285,8 +287,7 @@ int main(int argc, char *argv[]) { ...@@ -285,8 +287,7 @@ int main(int argc, char *argv[]) {
std::cout << "Grid" << i << " Number of DOFs: " << leafVertexCount << std::endl; std::cout << "Grid" << i << " Number of DOFs: " << leafVertexCount << std::endl;
// Neumann boundary // Neumann boundary
auto& neumannBoundary = neumannBoundaries[i]; neumannBoundaries[i] = BoundaryPatch<DefLeafGridView>(*leafViews[i]);
neumannBoundary = BoundaryPatch<DefLeafGridView>(*leafViews[i]);
// friction boundary // friction boundary
auto& frictionalBoundary = frictionalBoundaries[i]; auto& frictionalBoundary = frictionalBoundaries[i];
...@@ -348,7 +349,7 @@ int main(int argc, char *argv[]) { ...@@ -348,7 +349,7 @@ int main(int argc, char *argv[]) {
// Problem formulation: right-hand side // Problem formulation: right-hand side
externalForces[i] = externalForces[i] =
[&](double _relativeTime, Vector &_ell) { [&](double _relativeTime, Vector &_ell) {
assembler->assembleNeumann(neumannBoundaries[i], _ell, neumannFunction, assemblers[i]->assembleNeumann(neumannBoundaries[i], _ell, neumannFunction,
_relativeTime); _relativeTime);
_ell += gravityFunctionals[i]; _ell += gravityFunctionals[i];
}; };
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
gravity = 9.81 # [m/s^2] gravity = 9.81 # [m/s^2]
[io] [io]
data.write = true data.write = false #true
printProgress = false printProgress = false
restarts.first = 0 restarts.first = 0
restarts.spacing= 20 restarts.spacing= 20
restarts.write = true restarts.write = false #true
vtk.write = false vtk.write = false
[problem] [problem]
......
...@@ -101,7 +101,6 @@ template <class VectorTEMPLATE, class ScalarVectorTEMPLATE> class ProgramState { ...@@ -101,7 +101,6 @@ template <class VectorTEMPLATE, class ScalarVectorTEMPLATE> class ProgramState {
const std::vector<Vector>& _rhs, std::vector<Vector>& _x, const std::vector<Vector>& _rhs, std::vector<Vector>& _x,
Dune::ParameterTree const &_localParset) { Dune::ParameterTree const &_localParset) {
std::vector<const Matrix*> matrices_ptr(_matrices.size()); std::vector<const Matrix*> matrices_ptr(_matrices.size());
for (size_t i=0; i<matrices_ptr.size(); i++) { for (size_t i=0; i<matrices_ptr.size(); i++) {
matrices_ptr[i] = _matrices[i].get(); matrices_ptr[i] = _matrices[i].get();
...@@ -159,7 +158,9 @@ template <class VectorTEMPLATE, class ScalarVectorTEMPLATE> class ProgramState { ...@@ -159,7 +158,9 @@ template <class VectorTEMPLATE, class ScalarVectorTEMPLATE> class ProgramState {
v[i] = 0.0; v[i] = 0.0;
ell0[i].resize(u[i].size()); ell0[i].resize(u[i].size());
externalForces[i](relativeTime, ell0[i]); ell0[i] = 0.0;
// TODO
//externalForces[i](relativeTime, ell0[i]);
} }
// Initial displacement: Start from a situation of minimal stress, // Initial displacement: Start from a situation of minimal stress,
......
...@@ -25,6 +25,7 @@ SolverFactory<DeformedGrid, Nonlinearity, Matrix, Vector>::SolverFactory( ...@@ -25,6 +25,7 @@ SolverFactory<DeformedGrid, Nonlinearity, Matrix, Vector>::SolverFactory(
Solver::QUIET), Solver::QUIET),
transferOperators_(nBodyAssembler.getGrids().at(0)->maxLevel()) { transferOperators_(nBodyAssembler.getGrids().at(0)->maxLevel()) {
multigridStep_ = std::make_shared<Step>();
// tnnmg iteration step // tnnmg iteration step
multigridStep_->setMGType(parset.get<int>("main.multi"), parset.get<int>("main.pre"), parset.get<int>("main.post")); multigridStep_->setMGType(parset.get<int>("main.multi"), parset.get<int>("main.pre"), parset.get<int>("main.post"));
//multigridStep_->setIgnore(ignoreNodes); //multigridStep_->setIgnore(ignoreNodes);
......
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