Skip to content

Reply To: 3d droplet impact

#6674
abbas
Participant

ok thanks, got it.
can you explain how the following code generate a circle?
I think only rectangular and circle and triangle can be defined using the library of Openlb and if I want to create for example a hexagonal I have to write my own code.

template <typename S>
class IndicatorCircle2D : public IndicatorF2D<S> {
private:
const Vector<S,2> _center;
const S _radius;
const S _radius2;
public:
IndicatorCircle2D(Vector<S,2> center, S radius);
Vector<S,2> const& getCenter() const;
S const getRadius() const;
bool operator() (bool output[], const S input[]) override;
bool distance(S& distance, const Vector<S,2>& origin, const Vector<S,2>& direction, int iC=-1) override;
bool normal(Vector<S,2>& normal, const Vector<S,2>& origin, const Vector<S,2>& direction, int iC=-1) override;
S signedDistance(const Vector<S,2>& input) override;
using IndicatorF2D<S>::distance;
};