← Back to team overview

dolfin team mailing list archive

[Bug 698229] Re: Applying boundary condition to vector crashes

 

Fixed here:

   http://bazaar.launchpad.net/~dolfin-core/dolfin/main/revision/5702

The problem is with creating a Function using a SubSpace. This doesn't
really make sense unless the FunctionSpace has been collapse.

Solution is to throw an error.

** Changed in: dolfin
       Status: Confirmed => Fix Committed

-- 
You received this bug notification because you are a member of DOLFIN
Team, which is subscribed to DOLFIN.
https://bugs.launchpad.net/bugs/698229

Title:
  Applying boundary condition to vector crashes

Status in DOLFIN:
  Fix Committed

Bug description:
  
  The following code crashes with 

  PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation,
  probably memory access out of range

  It runs in revision no 5445, but crashes in 5446.

  ----

  #include <dolfin.h>
  #include "NavierStokes.h"

  using namespace dolfin;

  class Noslip : public SubDomain
  {
    bool inside(const Array<double>& x, bool on_boundary) const
    {
      return (x[1] < DOLFIN_EPS);
    }
  };

  int main() {

    UnitSquare mesh(2, 2);
    NavierStokes::FunctionSpace W(mesh);
    Noslip noslip;

    // Define bc on subspace
    SubSpace S(W, 0);
    Function zero(S);
    DirichletBC bc(S, zero, noslip);

    // Apply bc to vector
    Function z(W);
    bc.apply(z.vector()); // Fails!

    return 0;
  }

  and NavierStokes.h is generated from

  V = VectorElement("CG", "triangle", 2)
  Q = FiniteElement("CG", "triangle", 1)
  element = V * Q



References