Skip to content
Snippets Groups Projects
Commit ac5a6874 authored by Carsten Gräser's avatar Carsten Gräser
Browse files

[examples] Disable poisson-adaptive for dune-funcions < 2.11

The examples requires a fix that is not contained in 2.10
and makes composed grid functions work with bound unary
operators.
parent 66faabf3
Branches
Tags
1 merge request!258Add constraints support for dune-functions basis
......@@ -4,8 +4,10 @@ dune_target_enable_all_packages(hyperelasticity)
add_executable("linear-elasticity" linear-elasticity.cc)
dune_target_enable_all_packages(linear-elasticity)
add_executable("poisson-adaptive" poisson-adaptive.cc)
dune_target_enable_all_packages(poisson-adaptive)
if(dune-functions_VERSION VERSION_GREATER_EQUAL 2.11.0)
add_executable("poisson-adaptive" poisson-adaptive.cc)
dune_target_enable_all_packages(poisson-adaptive)
endif()
add_executable("poisson-pq2" poisson-pq2.cc)
dune_target_enable_all_packages(poisson-pq2)
......
......@@ -8,7 +8,6 @@
#include <tuple>
#include <dune/common/bitsetvector.hh>
#include <dune/common/version.hh>
#include <dune/common/stringutility.hh>
#include <dune/geometry/quadraturerules.hh>
......@@ -30,12 +29,8 @@
#include <dune/functions/gridfunctions/composedgridfunction.hh>
#include <dune/functions/gridfunctions/gridviewfunction.hh>
#if DUNE_VERSION_GT(DUNE_VTK, 2, 9)
#include <dune/vtk/vtkwriter.hh>
#include <dune/vtk/datacollectors/lagrangedatacollector.hh>
#else
#include <dune/grid/io/file/vtk/subsamplingvtkwriter.hh>
#endif
#include <dune/fufem/logger.hh>
#include <dune/fufem/parallel/elementcoloring.hh>
......@@ -320,14 +315,10 @@ int main (int argc, char *argv[]) try
// *********************************************
// Disable parallel assembly for UGGrid before 2.10
#if DUNE_VERSION_GT(DUNE_FUNCTIONS, 2, 9)
auto gridViewPartition = Dune::Fufem::coloredGridViewPartition(basis.gridView());
log("Grid coloring computed");
auto globalAssembler = GlobalAssembler(basis, basis, 0, std::cref(gridViewPartition), threadCount);
#else
auto globalAssembler = GlobalAssembler(basis, basis, 0);
#endif
{
using namespace ::Dune::Fufem::Forms;
......@@ -436,11 +427,7 @@ int main (int argc, char *argv[]) try
};
// Compute local error estimates
#if DUNE_VERSION_GT(DUNE_FUNCTIONS, 2, 9)
auto [error, eta] = hierarchicalErrorEstimator(a, residual, extensionBasis, extensionConstraints, defect, std::cref(gridViewPartition), threadCount);
#else
auto [error, eta] = hierarchicalErrorEstimator(a, residual, extensionBasis, extensionConstraints, defect);
#endif
log(Dune::formatString("Estimated total error : % 12.5e", error));
......@@ -451,7 +438,6 @@ int main (int argc, char *argv[]) try
{
auto u_initial = bindToCoefficients(trialFunction(basis), sol_initial);
auto d = bindToCoefficients(trialFunction(extensionBasis), defect);
#if DUNE_VERSION_GT(DUNE_VTK, 2, 9)
using Dune::Vtk::LagrangeDataCollector;
using Dune::Vtk::UnstructuredGridWriter;
using Dune::VTK::FieldInfo;
......@@ -460,12 +446,6 @@ int main (int argc, char *argv[]) try
vtkWriter.addPointData(u_initial, FieldInfo("sol_initial", FieldInfo::Type::scalar, 1));
vtkWriter.addPointData(d, FieldInfo("defect", FieldInfo::Type::scalar, 1));
vtkWriter.write(Dune::formatString("poisson-adaptive-%03d", refinementStep));
#else
Dune::SubsamplingVTKWriter<GridView> vtkWriter(gridView, Dune::refinementLevels(1));
vtkWriter.addVertexData(u, VTK::FieldInfo("sol", VTK::FieldInfo::Type::scalar, 1));
vtkWriter.addVertexData(d, VTK::FieldInfo("defect", VTK::FieldInfo::Type::scalar, 1));
vtkWriter.write(Dune::formatString("poisson-adaptive-%03d", refinementStep));
#endif
log("Solution written to vtk file");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment