23#ifndef OPENSWMMVIS_MESH_MESHCROSSFIELD_H
24#define OPENSWMMVIS_MESH_MESHCROSSFIELD_H
51 bool build(
const QRectF &
bbox,
const QVector<QVector<QPointF>> &alignedPolylines,
57 bool valid() const noexcept {
return m_valid; }
58 int cols() const noexcept {
return m_cols; }
59 int rows() const noexcept {
return m_rows; }
63 double thetaAt(
double x,
double y)
const;
66 void directionsAt(
double x,
double y, QPointF d[4])
const;
69 QPointF
cellU(
int col,
int row)
const;
74 bool m_constant =
false;
75 double m_constTheta = 0.0;
76 int m_cols = 0, m_rows = 0, m_sweeps = 0;
77 double m_x0 = 0.0, m_y0 = 0.0, m_pitch = 0.0;
78 QVector<double> m_ux, m_uy;
79 QVector<bool> m_pinned;
Definition meshcrossfield.h:33
bool cellPinned(int col, int row) const
Definition meshcrossfield.cpp:196
void directionsAt(double x, double y, QPointF d[4]) const
The four unit directions θ, θ+90°, θ+180°, θ+270° at (x, y).
Definition meshcrossfield.cpp:178
double thetaAt(double x, double y) const
Field angle in radians, folded to [0, π/2). Clamps outside the grid.
Definition meshcrossfield.cpp:154
void setConstant(double thetaDeg)
Constant field: every query returns thetaDeg (folded). valid() → true.
Definition meshcrossfield.cpp:147
bool valid() const noexcept
Definition meshcrossfield.h:57
int rows() const noexcept
Definition meshcrossfield.h:59
QPointF cellU(int col, int row) const
Raw representation vector (cos 4θ, sin 4θ) at a cell (tests).
Definition meshcrossfield.cpp:188
bool build(const QRectF &bbox, const QVector< QVector< QPointF > > &alignedPolylines, const Options &opts)
Solve the field over bbox with Dirichlet data along alignedPolylines (>= 2 points each; a closed ring...
Definition meshcrossfield.cpp:34
int cols() const noexcept
Definition meshcrossfield.h:58
int sweepsUsed() const noexcept
Definition meshcrossfield.h:60
int e
Definition inpmeshreader.cpp:41
QRectF bbox
Definition meshgenerator.cpp:166
Definition meshcommands.h:302
Definition meshcrossfield.h:36
double omega
SOR relaxation.
Definition meshcrossfield.h:40
int maxSweeps
SOR sweep cap.
Definition meshcrossfield.h:38
double tol
Stop when the max |Δu| over a sweep drops below this.
Definition meshcrossfield.h:39
double pitch
Grid spacing (map units). Required > 0 (use the region's h).
Definition meshcrossfield.h:37
double margin
Cells of padding around bbox on every side.
Definition meshcrossfield.h:41