Commit 0a1aad4d authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Release of version 2.8

parent 38f79c23
......@@ -3,13 +3,6 @@ before_script:
- . /duneci/bin/duneci-init-job
- duneci-install-module https://gitlab.dune-project.org/martin.nolte/dune-polygongrid
dune:2.7-debian-10-gcc-8-17:
image: registry.dune-project.org/docker/ci/dune:2.7-debian-10-gcc-8-17
script: duneci-standard-test
before_script:
- duneci-install-module -b releases/2.7 https://gitlab.dune-project.org/extensions/dune-alugrid.git
tags: [duneci]
.dune28: &dune28
script: duneci-standard-test
......
# We require version CMake version 3.1 to prevent issues
# with dune_enable_all_packages and older CMake versions.
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.13)
project(dune-vtk CXX)
if(NOT (dune-common_DIR OR dune-common_ROOT OR
......
......@@ -4,7 +4,7 @@
#Name of the module
Module: dune-vtk
Version: 0.2
Version: 2.8
#meta data
Author: Simon Praetorius
......@@ -13,7 +13,7 @@ Description: File reader and writer for the VTK Format
URL: https://gitlab.dune-project.org/extensions/dune-vtk
#depending on
Depends: dune-grid (>= 2.7) dune-localfunctions (>= 2.7)
Depends: dune-grid (>= 2.8) dune-localfunctions (>= 2.8)
Suggests: dune-functions dune-spgrid dune-polygongrid dune-alugrid dune-foamgrid dune-uggrid
Python-Requires:
Whitespace-Hook: Yes
......@@ -226,11 +226,7 @@ namespace Dune
int order (GeometryType type, std::size_t nNodes) const
{
for (int o = 1; o <= int(nNodes); ++o)
#if DUNE_VERSION_LT(DUNE_LOCALFUNCTIONS,2,8)
if (numLagrangePoints(type.id(), type.dim(), o) == std::size_t(nNodes))
#else
if (numLagrangePoints(type, o) == std::size_t(nNodes))
#endif
return o;
return 1;
......
......@@ -84,11 +84,7 @@ namespace Dune
std::int64_t shift = (insertionIndex == 0 ? 0 : (*offsets_)[insertionIndex-1]);
std::int64_t numNodes = (*offsets_)[insertionIndex] - shift;
#if DUNE_VERSION_LT(DUNE_LOCALFUNCTIONS,2,8)
[[maybe_unused]] std::int64_t maxNumNodes = numLagrangePoints(element.type().id(), element.type().dim(), 20);
#else
[[maybe_unused]] std::int64_t maxNumNodes = numLagrangePoints(element.type(), 20);
#endif
VTK_ASSERT(numNodes > 0 && numNodes < maxNumNodes);
int order = creator_->order(element.type(), numNodes);
......
......@@ -48,29 +48,16 @@ namespace Dune
}
/// Fill the lagrange points for the given topology type `Topology`
#if DUNE_VERSION_LT(DUNE_LOCALFUNCTIONS,2,8)
template <class Topology>
bool build ()
{
build(GeometryType(Topology{}));
return true;
}
#else
template <GeometryType::Id geometryId>
bool build ()
{
build(GeometryType(geometryId));
return true;
}
#endif
/// Returns whether the point set support the given topology type `Topology` and can
/// generate point for the given order.
#if DUNE_VERSION_LT(DUNE_LOCALFUNCTIONS,2,8)
template <class Topology>
#else
template <GeometryType::Id geometryId>
#endif
static bool supports (std::size_t order)
{
return true;
......
......@@ -90,11 +90,7 @@ template <class K>
template <class Points>
void LagrangePointSetBuilder<K,2>::operator() (GeometryType gt, int order, Points& points) const
{
#if DUNE_VERSION_LT(DUNE_LOCALFUNCTIONS,2,8)
std::size_t nPoints = numLagrangePoints(gt.id(), dim, order);
#else
std::size_t nPoints = numLagrangePoints(gt, order);
#endif
if (gt.isTriangle())
buildTriangle(nPoints, order, points);
......@@ -267,11 +263,7 @@ template <class K>
template <class Points>
void LagrangePointSetBuilder<K,3>::operator() (GeometryType gt, unsigned int order, Points& points) const
{
#if DUNE_VERSION_LT(DUNE_LOCALFUNCTIONS,2,8)
std::size_t nPoints = numLagrangePoints(gt.id(), dim, order);
#else
std::size_t nPoints = numLagrangePoints(gt, order);
#endif
if (gt.isTetrahedron())
buildTetra(nPoints, order, points);
......
......@@ -73,43 +73,24 @@ bool test(const Basis &basis, const Points &points, bool verbose)
return ret;
}
#if DUNE_VERSION_LT(DUNE_LOCALFUNCTIONS,2,8)
template <class Topology>
#else
template <Dune::GeometryType::Id geometryId>
#endif
bool test(unsigned int order, bool verbose = false)
{
#if DUNE_VERSION_LT(DUNE_LOCALFUNCTIONS,2,8)
typedef Dune::LagrangeBasisFactory<Dune::Vtk::LagrangePointSet, Topology::dimension, StorageField, ComputeField> BasisFactory;
typedef Dune::LagrangeCoefficientsFactory<Dune::Vtk::LagrangePointSet, Topology::dimension, double > LagrangeCoefficientsFactory;
#else
constexpr Dune::GeometryType geometry = geometryId;
typedef Dune::LagrangeBasisFactory<Dune::Vtk::LagrangePointSet, geometry.dim(), StorageField, ComputeField> BasisFactory;
typedef Dune::LagrangeCoefficientsFactory<Dune::Vtk::LagrangePointSet, geometry.dim(), double> LagrangeCoefficientsFactory;
#endif
bool ret = true;
for (unsigned int o = 0; o <= order; ++o)
{
#if DUNE_VERSION_LT(DUNE_LOCALFUNCTIONS,2,8)
const typename LagrangeCoefficientsFactory::Object *pointsPtr = LagrangeCoefficientsFactory::template create< Topology >( o );
#else
const typename LagrangeCoefficientsFactory::Object *pointsPtr = LagrangeCoefficientsFactory::template create< geometry >( o );
#endif
if ( pointsPtr == 0)
continue;
#if DUNE_VERSION_LT(DUNE_LOCALFUNCTIONS,2,8)
std::cout << "Testing " << Topology::name() << " in dimension " << Topology::dimension << " with order " << o << std::endl;
typename BasisFactory::Object &basis = *BasisFactory::template create<Topology>(o);
#else
std::cout << "Testing " << geometry << " with order " << o << std::endl;
typename BasisFactory::Object &basis = *BasisFactory::template create<geometry>(o);
#endif
ret |= test(basis,*pointsPtr,verbose);
......@@ -117,17 +98,10 @@ bool test(unsigned int order, bool verbose = false)
// derivatives in a human readabible form (aka LaTeX source)
#ifdef TEST_OUTPUT_FUNCTIONS
std::stringstream name;
#if DUNE_VERSION_LT(DUNE_LOCALFUNCTIONS,2,8)
name << "lagrange_" << Topology::name() << "_p" << o << ".basis";
std::ofstream out(name.str().c_str());
Dune::basisPrint<0,BasisFactory,typename BasisFactory::StorageField>(out,basis);
Dune::basisPrint<1,BasisFactory,typename BasisFactory::StorageField>(out,basis);
#else
name << "lagrange_" << geometry << "_p" << o << ".basis";
std::ofstream out(name.str().c_str());
Dune::basisPrint<0,BasisFactory,typename BasisFactory::StorageField,geometry>(out,basis);
Dune::basisPrint<1,BasisFactory,typename BasisFactory::StorageField,geometry>(out,basis);
#endif
#endif // TEST_OUTPUT_FUNCTIONS
LagrangeCoefficientsFactory::release( pointsPtr );
......@@ -176,36 +150,20 @@ int main ( int argc, char **argv )
bool tests = true;
#ifdef CHECKDIM1
#if DUNE_VERSION_LT(DUNE_LOCALFUNCTIONS,2,8)
tests &= test<Prism<Point> > (order); // line
tests &= test<Pyramid<Point> > (order); // line
#else
tests &= test<GeometryTypes::cube(1)>(order); // line
tests &= test<GeometryTypes::simplex(1)>(order); // line
#endif
#endif
#ifdef CHECKDIM2
#if DUNE_VERSION_LT(DUNE_LOCALFUNCTIONS,2,8)
tests &= test<Prism<Prism<Point> > > (order); // quad
tests &= test<Pyramid<Pyramid<Point> > >(order); // triangle
#else
tests &= test<GeometryTypes::cube(2)>(order); // quad
tests &= test<GeometryTypes::simplex(2)>(order); // triangle
#endif
#endif
#ifdef CHECKDIM3
#if DUNE_VERSION_LT(DUNE_LOCALFUNCTIONS,2,8)
tests &= test<Prism<Prism<Prism<Point> > > >(order); // hexahedron
// tests &= test<Prism<Pyramid<Pyramid<Point> > > >(order);
tests &= test<Pyramid<Pyramid<Pyramid<Point> > > >(order); // tetrahedron
#else
tests &= test<GeometryTypes::cube(3)>(order); // hexahedron
// tests &= test<GeometryTypes::prism>(order);
// tests &= test<GeometryTypes::pyramid>(order);
tests &= test<GeometryTypes::simplex(3)>(order);
#endif
#endif
return (tests ? 0 : 1);
......
......@@ -192,7 +192,7 @@ int main (int argc, char** argv)
reader_writer_test<ALUGridType<2>, Vtk::ParallelGridCreator<ALUGridType<2>>>(mpi, test, "ALUGridType<2, Parallel>", false);
reader_writer_test<ALUGridType<3>, Vtk::SerialGridCreator<ALUGridType<3>>>(mpi, test, "ALUGridType<3>");
#if DUNE_VERSION_LT(DUNE_GRID,2,7)
#if 0
// Currently the 2.7 branch is not working, due to a new bisection compatibility check in 3d
reader_writer_test<ALUGridType<3>, Vtk::ParallelGridCreator<ALUGridType<3>>>(mpi, test, "ALUGridType<3, Parallel>", false);
#endif
......
......@@ -161,7 +161,7 @@ int main (int argc, char** argv)
});
#endif
#if DUNE_VERSION_LT(DUNE_GRID,2,7) && HAVE_DUNE_ALUGRID
#if 0 && HAVE_DUNE_ALUGRID
// Test VtkWriter for ALUGrid. Currently the 2.7 branch is not working.
Hybrid::forEach(std::make_tuple(int_<2>{}, int_<3>{}), [&test,&mpi](auto dim)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment