Skip to content

Usage of PeriodicBasis together with PowerBasis leads to Segmentation Fault while assembling

The introduce-periodic-basis branch of dune-functions (see https://gitlab.dune-project.org/staging/dune-functions/-/merge_requests/263) adds a periodic Basis Wrapper to dune-functions. While it works in AMDiS out of the box for scalar Functionspaces, vectorvalued Functionspaces created with power<>() lead to a Segmentation fault while assembling. Minimal Example:

#include <config.h>
#include <amdis/AMDiS.hpp>
#include <amdis/LocalOperators.hpp>
#include <dune/grid/onedgrid.hh>
#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
#include <dune/functions/functionspacebases/lagrangebasis.hh>
#include <dune/functions/functionspacebases/periodicbasis.hh>

using namespace AMDiS;
int main(int argc, char** argv)
{
  Environment env(argc, argv);

  Dune::OneDGrid grid(10, 0.0, 1.0);
  
  using namespace Dune::Functions::BasisFactory;
  PeriodicIndexSet periodicIndexSet; // Doesn't need to be filled to reproduce the Error

  ProblemStat prob("prob", grid, power<3>(periodic(lagrange<1>(), periodicIndexSet), flatLexicographic()));

  prob.initialize(INIT_ALL);
  for (int i = 0; i<3; i++){
  prob.addMatrixOperator(sot(1.0), makeTreePath(i), makeTreePath(i));
  }
  AdaptInfo adaptInfo("adapt");
  prob.assemble(adaptInfo);
  prob.solve(adaptInfo);
}

Tested with ISTL and PETSc

Errormessage:

 *** Process received signal ***
 Signal: Segmentation fault (11)
 Signal code: Address not mapped (1)
 Failing at address: 0xc

Complete Errormessage with hardly readable stacktrace errormessage.txt Project was setup with amdisproject using the dune modules: amdis dune-common dune-geometry dune-localfunctions dune-typetree dune-uggrid dune-grid dune-istl dune-functions dune-spgrid dune-vtk

Edited by Porrmann, Maik