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

.

parent 1ef5b30f
No related branches found
No related tags found
No related merge requests found
...@@ -202,11 +202,6 @@ void StackedBlocksFactory<HostGridType, VectorType>::setBoundaryConditions() { ...@@ -202,11 +202,6 @@ void StackedBlocksFactory<HostGridType, VectorType>::setBoundaryConditions() {
for (int j=0; j<leafVertexCount; j++) { for (int j=0; j<leafVertexCount; j++) {
if (leafFaces_[i]->upper.containsVertex(j)) if (leafFaces_[i]->upper.containsVertex(j))
(*velocityDirichletNodes)[j][0] = true; (*velocityDirichletNodes)[j][0] = true;
#if MY_DIM == 3 //TODO: wrong, needs revision
if (leafFaces_[i]->front.containsVertex(j) || leafFaces_[i]->back.containsVertex(j))
zeroDirichletNodes->at(j)[2] = true;
#endif
} }
std::shared_ptr<LeafBoundaryCondition> velocityDirichletBoundary = std::make_shared<LeafBoundaryCondition>("dirichlet"); std::shared_ptr<LeafBoundaryCondition> velocityDirichletBoundary = std::make_shared<LeafBoundaryCondition>("dirichlet");
...@@ -229,6 +224,11 @@ void StackedBlocksFactory<HostGridType, VectorType>::setBoundaryConditions() { ...@@ -229,6 +224,11 @@ void StackedBlocksFactory<HostGridType, VectorType>::setBoundaryConditions() {
(*zeroDirichletNodes)[j][d] = true; (*zeroDirichletNodes)[j][d] = true;
} }
} }
#if MY_DIM == 3 //TODO: wrong, needs revision
if (leafFaces_[0]->front.containsVertex(j) || leafFaces_[0]->back.containsVertex(j))
(*zeroDirichletNodes)[j][2] = true;
#endif
} }
std::shared_ptr<LeafBoundaryCondition> zeroDirichletBoundary = std::make_shared<LeafBoundaryCondition>("dirichlet"); std::shared_ptr<LeafBoundaryCondition> zeroDirichletBoundary = std::make_shared<LeafBoundaryCondition>("dirichlet");
......
...@@ -77,7 +77,7 @@ maximumIterations = 10000 ...@@ -77,7 +77,7 @@ maximumIterations = 10000
verbosity = quiet verbosity = quiet
[solver.tnnmg.main] [solver.tnnmg.main]
pre = 10 pre = 1
multi = 5 # number of multigrid steps multi = 5 # number of multigrid steps
post = 0 post = 0
......
...@@ -177,10 +177,10 @@ void solveProblem(const ContactNetwork& contactNetwork, ...@@ -177,10 +177,10 @@ void solveProblem(const ContactNetwork& contactNetwork,
refSolver.solve(); refSolver.solve();
std::cout << correctionNorms.size() << std::endl; std::cout << correctionNorms.size() << std::endl;
if (initial) { /*if (initial) {
x = refX; x = refX;
return; return;
} }*/
// set up solver factory solver // set up solver factory solver
// set up functional // set up functional
......
...@@ -19,10 +19,10 @@ SolverFactory<Functional, BitVector>::SolverFactory( ...@@ -19,10 +19,10 @@ SolverFactory<Functional, BitVector>::SolverFactory(
const BitVector& ignoreNodes) : const BitVector& ignoreNodes) :
J_(Dune::Solvers::wrap_own_share<const Functional>(std::forward<Functional>(J))) { J_(Dune::Solvers::wrap_own_share<const Functional>(std::forward<Functional>(J))) {
auto localSolver = Dune::TNNMG::gaussSeidelLocalSolver(LocalSolver()); //auto localSolver = Dune::TNNMG::gaussSeidelLocalSolver(LocalSolver());
nonlinearSmoother_ = std::make_shared<NonlinearSmoother>(*J_, dummyIterate_, localSolver); //nonlinearSmoother_ = std::make_shared<NonlinearSmoother>(*J_, dummyIterate_, localSolver);
//nonlinearSmoother_ = std::make_shared<NonlinearSmoother>(*J_, dummyIterate_, LocalSolver()); nonlinearSmoother_ = std::make_shared<NonlinearSmoother>(*J_, dummyIterate_, LocalSolver());
auto linearSolver_ptr = Dune::Solvers::wrap_own_share<std::decay_t<LinearSolver>>(std::forward<LinearSolver>(linearSolver)); auto linearSolver_ptr = Dune::Solvers::wrap_own_share<std::decay_t<LinearSolver>>(std::forward<LinearSolver>(linearSolver));
......
...@@ -28,8 +28,8 @@ class SolverFactory { ...@@ -28,8 +28,8 @@ class SolverFactory {
using Vector = typename Functional::Vector; using Vector = typename Functional::Vector;
using BitVector = BitVectorType; using BitVector = BitVectorType;
using LocalSolver = Dune::TNNMG::ScalarObstacleSolver;//LocalBisectionSolver; using LocalSolver = LocalBisectionSolver;//Dune::TNNMG::ScalarObstacleSolver;//LocalBisectionSolver;
using NonlinearSmoother = Dune::TNNMG::NonlinearGSStep<Functional, Dune::TNNMG::GaussSeidelLocalSolver<LocalSolver>, BitVector>; using NonlinearSmoother = Dune::TNNMG::NonlinearGSStep<Functional, LocalBisectionSolver, BitVector>;//Dune::TNNMG::NonlinearGSStep<Functional, Dune::TNNMG::GaussSeidelLocalSolver<LocalSolver>, BitVector>;
using Linearization = Linearization<Functional, BitVector>; using Linearization = Linearization<Functional, BitVector>;
using DefectProjection = typename Dune::TNNMG::ObstacleDefectProjection; using DefectProjection = typename Dune::TNNMG::ObstacleDefectProjection;
......
...@@ -352,13 +352,13 @@ auto coordinateRestriction(const ShiftedFunctional<M, V, Nonlinearity, R>& f, co ...@@ -352,13 +352,13 @@ auto coordinateRestriction(const ShiftedFunctional<M, V, Nonlinearity, R>& f, co
auto&& phii = f.phi().restriction(i); auto&& phii = f.phi().restriction(i);
/*auto v = ri; auto v = ri;
double const vnorm = v.two_norm(); double const vnorm = v.two_norm();
if (vnorm > 1.0) if (vnorm > 1.0)
v /= vnorm;*/ v /= vnorm;
//return FirstOrderModelFunctional<LocalVector, decltype(phii), LocalLowerObstacle, LocalUpperObstacle, LocalVector, LocalVector, Range>(*Aii_p, std::move(ri), std::move(phii), std::move(dli), std::move(dui), std::move(f.origin()[i]), std::move(v)); return FirstOrderModelFunctional<LocalVector, decltype(phii), LocalLowerObstacle, LocalUpperObstacle, LocalVector, LocalVector, Range>(*Aii_p, std::move(ri), std::move(phii), std::move(dli), std::move(dui), std::move(f.origin()[i]), std::move(v));
return Functional<LocalMatrix&, LocalVector, decltype(phii), LocalLowerObstacle, LocalUpperObstacle, Range>(*Aii_p, std::move(ri), std::move(phii), std::move(dli), std::move(dui)); //return Functional<LocalMatrix&, LocalVector, decltype(phii), LocalLowerObstacle, LocalUpperObstacle, Range>(*Aii_p, std::move(ri), std::move(phii), std::move(dli), std::move(dui));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment