dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #20609
[Bug 698229] [NEW] Applying boundary condition to vector crashes
Public bug reported:
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
** Affects: dolfin
Importance: Undecided
Status: New
--
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:
New
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
Follow ups
References