Dear all,
I've read this question on how to create a Dirichlet boundary condition. I've tried and failed, but I don't know what I am doing wrong.
The test is simple, I have to clamp a vertex in one direction, or both, and here's my vertex detect class:
class vertexDetect : public SubDomain
{
public:
vertexDetect(Point p) : p_(p) {}
bool inside(const Array<double>& x, bool on_boundary) const
{
return (p_.distance(x) < GEOMETRIC_TOL);
}
private:
Point p_;
};
When setting the BCs, I simply do this:
Constant clamped(0.0, 0.0);
vertexDetect vd(Point(2.0, 0.0));
DirichletBC bcTest(*V, clamped, vd, "pointwise");
std::vector<const DirichletBC*> bcs { &bcRight, &bcTest };
Unfortunately, the domain moves where it shouldn't.
Am I missing something?
Thanks!