Skip to content
Snippets Groups Projects
Commit 83faa6a8 authored by oliver.sander_at_tu-dresden.de's avatar oliver.sander_at_tu-dresden.de
Browse files

Merge branch 'lisa-cleanup' into 'master'

Various minor improvements by Lisa

See merge request !23
parents da77ce6a ebe0dd2e
No related branches found
No related tags found
1 merge request!23Various minor improvements by Lisa
Pipeline #27835 passed
...@@ -13,7 +13,3 @@ dune:git clang C++17: ...@@ -13,7 +13,3 @@ dune:git clang C++17:
dune:git gcc-8 C++17: dune:git gcc-8 C++17:
image: registry.dune-project.org/docker/ci/dune:git-debian-10-gcc-8-17 image: registry.dune-project.org/docker/ci/dune:git-debian-10-gcc-8-17
script: duneci-standard-test script: duneci-standard-test
dune:git gcc-6 C++14:
image: registry.dune-project.org/docker/ci/dune:git-debian-9-gcc-6-14
script: duneci-standard-test
...@@ -28,6 +28,12 @@ class FEAssembler { ...@@ -28,6 +28,12 @@ class FEAssembler {
public: public:
const Basis basis_; const Basis basis_;
/** \brief Partition type on which to assemble
*
* We want a fully nonoverlapping partition, and therefore need to skip ghost elements.
*/
static constexpr auto partitionType = Dune::Partitions::interiorBorder;
protected: protected:
LocalFEStiffness<GridView, LocalFEStiffness<GridView,
...@@ -70,7 +76,7 @@ getNeighborsPerVertex(Dune::MatrixIndexSet& nb) const ...@@ -70,7 +76,7 @@ getNeighborsPerVertex(Dune::MatrixIndexSet& nb) const
nb.resize(n, n); nb.resize(n, n);
for (const auto& element : elements(basis_.getGridView(), Dune::Partitions::interior)) for (const auto& element : elements(basis_.getGridView(), partitionType))
{ {
const typename Basis::LocalFiniteElement& lfe = basis_.getLocalFiniteElement(element); const typename Basis::LocalFiniteElement& lfe = basis_.getLocalFiniteElement(element);
...@@ -111,7 +117,7 @@ assembleGradientAndHessian(const VectorType& sol, ...@@ -111,7 +117,7 @@ assembleGradientAndHessian(const VectorType& sol,
gradient.resize(sol.size()); gradient.resize(sol.size());
gradient = 0; gradient = 0;
for (const auto& element : elements(basis_.getGridView(), Dune::Partitions::interior)) for (const auto& element : elements(basis_.getGridView(), partitionType))
{ {
const int numOfBaseFct = basis_.getLocalFiniteElement(element).localBasis().size(); const int numOfBaseFct = basis_.getLocalFiniteElement(element).localBasis().size();
...@@ -159,7 +165,7 @@ computeEnergy(const VectorType& sol) const ...@@ -159,7 +165,7 @@ computeEnergy(const VectorType& sol) const
DUNE_THROW(Dune::Exception, "Solution vector doesn't match the basis!"); DUNE_THROW(Dune::Exception, "Solution vector doesn't match the basis!");
// Loop over all elements // Loop over all elements
for (const auto& element : elements(basis_.getGridView(), Dune::Partitions::interior)) for (const auto& element : elements(basis_.getGridView(), partitionType))
{ {
// Number of degrees of freedom on this element // Number of degrees of freedom on this element
size_t nDofs = basis_.getLocalFiniteElement(element).localBasis().size(); size_t nDofs = basis_.getLocalFiniteElement(element).localBasis().size();
......
...@@ -68,11 +68,12 @@ energy(const Entity& element, ...@@ -68,11 +68,12 @@ energy(const Entity& element,
const LocalFiniteElement& localFiniteElement, const LocalFiniteElement& localFiniteElement,
const VectorType& localSolution) const const VectorType& localSolution) const
{ {
int rank = Dune::MPIHelper::getCollectiveCommunication().rank();
double pureEnergy; double pureEnergy;
std::vector<Dune::FieldVector<adouble,blocksize> > localASolution(localSolution.size()); std::vector<Dune::FieldVector<adouble,blocksize> > localASolution(localSolution.size());
trace_on(1); trace_on(rank);
adouble energy = 0; adouble energy = 0;
...@@ -84,7 +85,7 @@ energy(const Entity& element, ...@@ -84,7 +85,7 @@ energy(const Entity& element,
energy >>= pureEnergy; energy >>= pureEnergy;
trace_off(); trace_off(rank);
return pureEnergy; return pureEnergy;
} }
...@@ -103,6 +104,7 @@ assembleGradientAndHessian(const Entity& element, ...@@ -103,6 +104,7 @@ assembleGradientAndHessian(const Entity& element,
const VectorType& localSolution, const VectorType& localSolution,
VectorType& localGradient) VectorType& localGradient)
{ {
int rank = Dune::MPIHelper::getCollectiveCommunication().rank();
// Tape energy computation. We may not have to do this every time, but it's comparatively cheap. // Tape energy computation. We may not have to do this every time, but it's comparatively cheap.
energy(element, localFiniteElement, localSolution); energy(element, localFiniteElement, localSolution);
...@@ -121,7 +123,7 @@ assembleGradientAndHessian(const Entity& element, ...@@ -121,7 +123,7 @@ assembleGradientAndHessian(const Entity& element,
// Compute gradient // Compute gradient
std::vector<double> g(nDoubles); std::vector<double> g(nDoubles);
gradient(1,nDoubles,xp.data(),g.data()); // gradient evaluation gradient(rank,nDoubles,xp.data(),g.data()); // gradient evaluation
// Copy into Dune type // Copy into Dune type
localGradient.resize(localSolution.size()); localGradient.resize(localSolution.size());
...@@ -151,7 +153,7 @@ assembleGradientAndHessian(const Entity& element, ...@@ -151,7 +153,7 @@ assembleGradientAndHessian(const Entity& element,
v[i*blocksize + k] = (k==ii); v[i*blocksize + k] = (k==ii);
int rc= 3; int rc= 3;
MINDEC(rc, hess_vec(1, nDoubles, xp.data(), v.data(), w.data())); MINDEC(rc, hess_vec(rank, nDoubles, xp.data(), v.data(), w.data()));
if (rc < 0) if (rc < 0)
DUNE_THROW(Dune::Exception, "ADOL-C has returned with error code " << rc << "!"); DUNE_THROW(Dune::Exception, "ADOL-C has returned with error code " << rc << "!");
...@@ -181,7 +183,7 @@ assembleGradientAndHessian(const Entity& element, ...@@ -181,7 +183,7 @@ assembleGradientAndHessian(const Entity& element,
tangent[(j/blocksize)*embeddedBlocksize+i][j] = orthonormalFrame[j/blocksize][j%blocksize][i]; tangent[(j/blocksize)*embeddedBlocksize+i][j] = orthonormalFrame[j/blocksize][j%blocksize][i];
} }
hess_mat(1,nDoubles,nDirections,xp.data(),tangent,rawHessian); hess_mat(rank,nDoubles,nDirections,xp.data(),tangent,rawHessian);
// Copy Hessian into Dune data type // Copy Hessian into Dune data type
for(size_t i=0; i<nDoubles; i++) for(size_t i=0; i<nDoubles; i++)
......
...@@ -40,16 +40,8 @@ setup(const typename BasisType::GridView::Grid& grid, ...@@ -40,16 +40,8 @@ setup(const typename BasisType::GridView::Grid& grid,
int nu2, int nu2,
int baseIterations, int baseIterations,
double baseTolerance) double baseTolerance)
{
#if HAVE_DUNE_PARMG
Dune::Timer setupTimer;
mgSetup_ = std::make_unique<MGSetup>(grid);
mgSetup_->overlap(true);
mgSetup_->setupSmoother(1.0);
if (grid.comm().rank()==0) {
std::cout << "Parallel multigrid setup took " << setupTimer.stop() << " seconds." << std::endl;
#endif
grid_ = &grid; grid_ = &grid;
assembler_ = assembler; assembler_ = assembler;
x_ = x; x_ = x;
...@@ -59,10 +51,30 @@ setup(const typename BasisType::GridView::Grid& grid, ...@@ -59,10 +51,30 @@ setup(const typename BasisType::GridView::Grid& grid,
innerIterations_ = multigridIterations; innerIterations_ = multigridIterations;
innerTolerance_ = mgTolerance; innerTolerance_ = mgTolerance;
ignoreNodes_ = std::make_shared<Dune::BitSetVector<blocksize>>(dirichletNodes); ignoreNodes_ = std::make_shared<Dune::BitSetVector<blocksize>>(dirichletNodes);
baseIterations_ = baseIterations;
baseTolerance_ = baseTolerance;
int numLevels = grid_->maxLevel()+1; int numLevels = grid_->maxLevel()+1;
#if !HAVE_DUNE_PARMG #if HAVE_DUNE_PARMG
Dune::Timer setupTimer;
mgSetup_ = std::make_unique<MGSetup>(grid);
mgSetup_->overlap(false);
mgSetup_->ignore(std::const_pointer_cast<Dune::BitSetVector<blocksize> >(ignoreNodes_));
BasisType feBasis(grid.levelGridView(grid.maxLevel()));
DuneFunctionsBasis<BasisType> basis(feBasis);
innerMultigridStep_ = std::make_unique<Dune::ParMG::Multigrid<VectorType> >();
innerMultigridStep_->mu_ = mu;
innerMultigridStep_->preSmootherSteps_ = nu1;
innerMultigridStep_->postSmootherSteps_ = nu2;
if (grid.comm().rank()==0)
std::cout << "Parallel multigrid setup took " << setupTimer.stop() << " seconds." << std::endl;
#else
DuneFunctionsBasis<BasisType> basis(grid.leafGridView());
// //////////////////////////////// // ////////////////////////////////
// Create a multigrid solver // Create a multigrid solver
// //////////////////////////////// // ////////////////////////////////
...@@ -87,11 +99,6 @@ setup(const typename BasisType::GridView::Grid& grid, ...@@ -87,11 +99,6 @@ setup(const typename BasisType::GridView::Grid& grid,
baseNorm, baseNorm,
Solver::QUIET); Solver::QUIET);
#endif #endif
#endif
#if HAVE_DUNE_PARMG
mgSetup_->ignore(std::const_pointer_cast<Dune::BitSetVector<blocksize> >(ignoreNodes_));
#else
// Make pre and postsmoothers // Make pre and postsmoothers
auto presmoother = std::make_shared< TrustRegionGSStep<MatrixType, CorrectionType> >(); auto presmoother = std::make_shared< TrustRegionGSStep<MatrixType, CorrectionType> >();
auto postsmoother = std::make_shared< TrustRegionGSStep<MatrixType, CorrectionType> >(); auto postsmoother = std::make_shared< TrustRegionGSStep<MatrixType, CorrectionType> >();
...@@ -108,13 +115,6 @@ setup(const typename BasisType::GridView::Grid& grid, ...@@ -108,13 +115,6 @@ setup(const typename BasisType::GridView::Grid& grid,
// ////////////////////////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////////////////////////
// Assemble a Laplace matrix to create a norm that's equivalent to the H1-norm // Assemble a Laplace matrix to create a norm that's equivalent to the H1-norm
// ////////////////////////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////////////////////////
#if HAVE_DUNE_PARMG
BasisType feBasis(grid.levelGridView(grid.maxLevel()));
DuneFunctionsBasis<BasisType> basis(feBasis);
#else
DuneFunctionsBasis<BasisType> basis(grid.leafGridView());
#endif
OperatorAssembler<DuneFunctionsBasis<BasisType>,DuneFunctionsBasis<BasisType>,Dune::Partitions::Interior> operatorAssembler(basis, basis); OperatorAssembler<DuneFunctionsBasis<BasisType>,DuneFunctionsBasis<BasisType>,Dune::Partitions::Interior> operatorAssembler(basis, basis);
LaplaceAssembler<GridType, LaplaceAssembler<GridType,
...@@ -129,19 +129,6 @@ setup(const typename BasisType::GridView::Grid& grid, ...@@ -129,19 +129,6 @@ setup(const typename BasisType::GridView::Grid& grid,
h1SemiNorm_ = std::make_shared< H1SemiNorm<CorrectionType> >(*A); h1SemiNorm_ = std::make_shared< H1SemiNorm<CorrectionType> >(*A);
#if HAVE_DUNE_PARMG
innerMultigridStep_ = std::make_unique<Dune::ParMG::Multigrid<VectorType> >();
innerMultigridStep_->mu_ = mu;
innerMultigridStep_->preSmootherSteps_ = nu1;
innerMultigridStep_->postSmootherSteps_ = nu2;
#else
innerSolver_ = std::make_shared<LoopSolver<CorrectionType> >(mmgStep,
innerIterations_,
innerTolerance_,
h1SemiNorm_,
Solver::REDUCED);
#endif
// ////////////////////////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////////////////////////
// Assemble a mass matrix to create a norm that's equivalent to the L2-norm // Assemble a mass matrix to create a norm that's equivalent to the L2-norm
// This will be used to monitor the gradient // This will be used to monitor the gradient
...@@ -167,6 +154,11 @@ setup(const typename BasisType::GridView::Grid& grid, ...@@ -167,6 +154,11 @@ setup(const typename BasisType::GridView::Grid& grid,
indices.exportIdx(*hessianMatrix_); indices.exportIdx(*hessianMatrix_);
#if !HAVE_DUNE_PARMG #if !HAVE_DUNE_PARMG
innerSolver_ = std::make_shared<LoopSolver<CorrectionType> >(mmgStep,
innerIterations_,
innerTolerance_,
h1SemiNorm_,
Solver::REDUCED);
// //////////////////////////////////// // ////////////////////////////////////
// Create the transfer operators // Create the transfer operators
// //////////////////////////////////// // ////////////////////////////////////
...@@ -248,9 +240,6 @@ void TrustRegionSolver<BasisType,VectorType>::solve() ...@@ -248,9 +240,6 @@ void TrustRegionSolver<BasisType,VectorType>::solve()
BasisType basis(grid_->levelGridView(grid_->maxLevel())); BasisType basis(grid_->levelGridView(grid_->maxLevel()));
BasisType coarseBasis(grid_->levelGridView(0)); BasisType coarseBasis(grid_->levelGridView(0));
std::vector<BoxConstraint<typename VectorType::field_type, blocksize>> coarseTrustRegionObstacles(coarseBasis.size()); std::vector<BoxConstraint<typename VectorType::field_type, blocksize>> coarseTrustRegionObstacles(coarseBasis.size());
int numLevels = grid_->maxLevel()+1;
auto& levelOp = mgSetup_->levelOps_;
#endif #endif
MaxNormTrustRegion<blocksize> trustRegion(basis.size(), initialTrustRegionRadius_); MaxNormTrustRegion<blocksize> trustRegion(basis.size(), initialTrustRegionRadius_);
...@@ -287,6 +276,10 @@ void TrustRegionSolver<BasisType,VectorType>::solve() ...@@ -287,6 +276,10 @@ void TrustRegionSolver<BasisType,VectorType>::solve()
*hessianMatrix_, *hessianMatrix_,
i==0 // assemble occupation pattern only for the first call i==0 // assemble occupation pattern only for the first call
); );
#if HAVE_DUNE_PARMG
std::function<void(VectorType&)> accumulate = Dune::ParMG::makeAccumulate<VectorType>(*(mgSetup_->comms_.back()));
accumulate(rhs);
#endif
rhs *= -1; // The right hand side is the _negative_ gradient rhs *= -1; // The right hand side is the _negative_ gradient
...@@ -306,15 +299,13 @@ void TrustRegionSolver<BasisType,VectorType>::solve() ...@@ -306,15 +299,13 @@ void TrustRegionSolver<BasisType,VectorType>::solve()
if (this->verbosity_ == Solver::FULL) if (this->verbosity_ == Solver::FULL)
std::cout << "Assembly took " << gradientTimer.elapsed() << " sec." << std::endl; std::cout << "Assembly took " << gradientTimer.elapsed() << " sec." << std::endl;
// Transfer matrix data
stiffnessMatrix = *hessianMatrix_;
#if HAVE_DUNE_PARMG #if HAVE_DUNE_PARMG
Dune::ParMG::collectDiagonal(stiffnessMatrix, *mgSetup_->comms_.back()); if (!mgSetup_->overlap())
Dune::ParMG::collectDiagonal(*hessianMatrix_, *mgSetup_->comms_.back());
mgSetup_->matrix(hessianMatrix_); mgSetup_->matrix(hessianMatrix_);
levelOp.back().maybeRestrictToMaster(rhs);
#endif #endif
// Transfer matrix data
stiffnessMatrix = *hessianMatrix_;
recomputeGradientHessian = false; recomputeGradientHessian = false;
...@@ -323,17 +314,22 @@ void TrustRegionSolver<BasisType,VectorType>::solve() ...@@ -323,17 +314,22 @@ void TrustRegionSolver<BasisType,VectorType>::solve()
CorrectionType corr(rhs.size()); CorrectionType corr(rhs.size());
corr = 0; corr = 0;
//Take the obstacles on the finest grid and give them to the multigrid solver, it will create a hierarchy for all coarser grids
trustRegionObstacles = trustRegion.obstacles();
#if ! HAVE_DUNE_PARMG #if ! HAVE_DUNE_PARMG
mgStep->setProblem(stiffnessMatrix, corr, rhs); mgStep->setProblem(stiffnessMatrix, corr, rhs);
trustRegionObstacles = trustRegion.obstacles();
mgStep->setObstacles(trustRegionObstacles); mgStep->setObstacles(trustRegionObstacles);
#else #else
mgSetup_->setupLevelOps(); mgSetup_->setupObstacles(std::make_shared< std::vector<BoxConstraint<typename VectorType::field_type, blocksize>> >(trustRegionObstacles));
mgSetup_->setupSmoother(damping_);
auto& levelOp = mgSetup_->levelOps_;
bool enableCoarseCorrection = true; bool enableCoarseCorrection = true;
if (enableCoarseCorrection) if (enableCoarseCorrection)
mgSetup_->setupCoarseIPOPTSolver(); mgSetup_->setupCoarseIPOPTSolver(baseTolerance_, baseIterations_);
else else
mgSetup_->setupCoarseNullSolver(); mgSetup_->setupCoarseNullSolver();
...@@ -343,29 +339,15 @@ void TrustRegionSolver<BasisType,VectorType>::solve() ...@@ -343,29 +339,15 @@ void TrustRegionSolver<BasisType,VectorType>::solve()
using ProjGS = Dune::ParMG::ParallelProjectedGS<MatrixType, VectorType>; using ProjGS = Dune::ParMG::ParallelProjectedGS<MatrixType, VectorType>;
using namespace Dune::ParMG; using namespace Dune::ParMG;
auto& levelOp = mgSetup_->levelOps_;
trustRegionObstacles = trustRegion.obstacles();
for (int i = 0; i < coarseTrustRegionObstacles.size(); i++)
coarseTrustRegionObstacles[i] = trustRegionObstacles[i];
mgSetup_->setCoarseObstacles(coarseTrustRegionObstacles);
ProjGS projGs(&stiffnessMatrix, &trustRegionObstacles, mgSetup_->ignores_.back().get()); ProjGS projGs(&stiffnessMatrix, &trustRegionObstacles, mgSetup_->ignores_.back().get());
projGs.accumulate([&](VectorType& x) { projGs.accumulate([&](VectorType& x) {
levelOp.back().maybeCopyFromMaster(x); levelOp.back().maybeCopyFromMaster(x);
}); });
projGs.dampening(1.0); projGs.dampening(1.0);
std::function<void(VectorType&)> collect = Dune::ParMG::makeCollect<VectorType>(*(mgSetup_->comms_.back()));
std::function<void(VectorType&)> restrictToMaster = [op=levelOp.back()](VectorType& x) { op.maybeRestrictToMaster(x); }; std::function<void(VectorType&)> restrictToMaster = [op=levelOp.back()](VectorType& x) { op.maybeRestrictToMaster(x); };
restrictToMaster(rhs);
auto energyFunctional = Dune::ParMG::makeParallelEnergyFunctional(
stiffnessMatrix,
rhs,
grid_->comm(),
//collect
restrictToMaster
);
// matrix, b, dofmap, master);
//Distributed energy norm //Distributed energy norm
auto energyNorm = Dune::ParMG::parallelEnergyNorm<VectorType>(stiffnessMatrix, restrictToMaster, grid_->comm()); auto energyNorm = Dune::ParMG::parallelEnergyNorm<VectorType>(stiffnessMatrix, restrictToMaster, grid_->comm());
...@@ -377,30 +359,16 @@ void TrustRegionSolver<BasisType,VectorType>::solve() ...@@ -377,30 +359,16 @@ void TrustRegionSolver<BasisType,VectorType>::solve()
levelOp.back().maybeCopyFromMaster(corr); levelOp.back().maybeCopyFromMaster(corr);
double J = 0.0;
VectorType b; VectorType b;
unsigned step = 0; unsigned step = 0;
int activeObstacles;
MPI_Barrier(grid_->comm()); MPI_Barrier(grid_->comm());
auto realIterationStep = [&](VectorType& correction) { auto realIterationStep = [&](VectorType& innerIterate) {
auto& project = projGs.project_;
projGs.apply(correction, rhs);
// prepare truncation
auto currentIgnore = std::make_shared<Dune::BitSetVector<VectorType::block_type::dimension> >(*ignoreNodes_);
auto extraIgnore = std::make_shared<Dune::BitSetVector<VectorType::block_type::dimension> >(ignoreNodes_->size(), false);
project.ignoreActive(correction, *currentIgnore);
project.ignoreActive(correction, *extraIgnore);
mgSetup_->ignore(currentIgnore);
assert(currentIgnore->count() - ignoreNodes_->count() == extraIgnore->count());
activeObstacles = extraIgnore->count();
// Create vector b to keep rhs untouched! // Create vector b to keep rhs untouched!
b = rhs; b = rhs;
innerMultigridStep_->apply(correction, b);
project(correction);
J = energyFunctional(correction); // The variable innerIterate is the correction that will be added
// to the current iterate in the trust region step.
innerMultigridStep_->apply(innerIterate, b);
++step; ++step;
}; };
...@@ -410,22 +378,9 @@ void TrustRegionSolver<BasisType,VectorType>::solve() ...@@ -410,22 +378,9 @@ void TrustRegionSolver<BasisType,VectorType>::solve()
auto innerSolver_ = std::make_shared< LoopSolver<CorrectionType> >(iterationStep, auto innerSolver_ = std::make_shared< LoopSolver<CorrectionType> >(iterationStep,
innerIterations_, innerIterations_,
innerTolerance_, innerTolerance_,
// h1SemiNorm_, // h1SemiNorm_, //TODO: test this!
solverNorm, solverNorm,
NumProc::QUIET); NumProc::QUIET);
innerSolver_->addCriterion(
[&]() {
return Dune::formatString(" % 12.10e", J);
},
" energy "
);
innerSolver_->addCriterion(
[&]() {
return Dune::formatString(" % 9d", activeObstacles);
},
" activeObs"
);
#endif #endif
innerSolver_->preprocess(); innerSolver_->preprocess();
......
...@@ -119,6 +119,12 @@ protected: ...@@ -119,6 +119,12 @@ protected:
/** \brief Error tolerance of the multigrid QP solver */ /** \brief Error tolerance of the multigrid QP solver */
double innerTolerance_; double innerTolerance_;
/** \brief Maximum number of base solver iterations */
int baseIterations_;
/** \brief Error tolerance of the base solver inside the multigrid QP solver */
double baseTolerance_;
/** \brief Hessian matrix */ /** \brief Hessian matrix */
std::shared_ptr<MatrixType> hessianMatrix_; std::shared_ptr<MatrixType> hessianMatrix_;
......
...@@ -185,8 +185,7 @@ int main (int argc, char *argv[]) try ...@@ -185,8 +185,7 @@ int main (int argc, char *argv[]) try
BoundaryPatch<GridView> dirichletBoundary(gridView, dirichletVertices); BoundaryPatch<GridView> dirichletBoundary(gridView, dirichletVertices);
BoundaryPatch<GridView> neumannBoundary(gridView, neumannVertices); BoundaryPatch<GridView> neumannBoundary(gridView, neumannVertices);
if (mpiHelper.rank()==0) std::cout << "On process " << mpiHelper.rank() << ": Neumann boundary has " << neumannBoundary.numFaces() << " faces\n";
std::cout << "Neumann boundary has " << neumannBoundary.numFaces() << " faces\n";
BitSetVector<1> dirichletNodes(feBasis.size(), false); BitSetVector<1> dirichletNodes(feBasis.size(), false);
...@@ -257,6 +256,7 @@ int main (int argc, char *argv[]) try ...@@ -257,6 +256,7 @@ int main (int argc, char *argv[]) try
neumannFunction = std::make_shared<NeumannFunction>(parameterSet.get<FieldVector<double,dim> >("neumannValues"), neumannFunction = std::make_shared<NeumannFunction>(parameterSet.get<FieldVector<double,dim> >("neumannValues"),
homotopyParameter); homotopyParameter);
if (mpiHelper.rank()==0)
std::cout << "Neumann values: " << parameterSet.get<FieldVector<double,dim> >("neumannValues") << std::endl; std::cout << "Neumann values: " << parameterSet.get<FieldVector<double,dim> >("neumannValues") << std::endl;
} }
...@@ -267,6 +267,7 @@ int main (int argc, char *argv[]) try ...@@ -267,6 +267,7 @@ int main (int argc, char *argv[]) try
} }
// Assembler using ADOL-C // Assembler using ADOL-C
if (mpiHelper.rank()==0)
std::cout << "Selected energy is: " << parameterSet.get<std::string>("energy") << std::endl; std::cout << "Selected energy is: " << parameterSet.get<std::string>("energy") << std::endl;
std::shared_ptr<Elasticity::LocalEnergy<GridView, std::shared_ptr<Elasticity::LocalEnergy<GridView,
FEBasis::LocalView::Tree::FiniteElement, FEBasis::LocalView::Tree::FiniteElement,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment