Applying boundary condition to vector crashes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DOLFIN |
Fix Released
|
High
|
Unassigned |
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:
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(
return 0;
}
and NavierStokes.h is generated from
V = VectorElement("CG", "triangle", 2)
Q = FiniteElement("CG", "triangle", 1)
element = V * Q
Changed in dolfin: | |
status: | New → Confirmed |
importance: | Undecided → High |
Changed in dolfin: | |
milestone: | none → 0.9.10 |
Changed in dolfin: | |
status: | Fix Committed → Fix Released |
Does it work with
Constant zero(0.0);
?