|
DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
|
One-dimensional profile for inlet/outlet boundary data. More...
#include <EulerBC.hpp>
Public Member Functions | |
| OneDimProfile (const MPIInfo &_mpi) | |
| Construct with MPI communicator (no allocation yet). | |
| void | SortNodes () |
| Sort node coordinates in ascending order. | |
| index | Size () const |
| Return the number of cells (= nodes.size() - 1). | |
| real | Len (index i) |
Return the length of cell i (= nodes[i+1] - nodes[i]). | |
| void | GenerateUniform (index size, int nvars, real minV, real maxV) |
| Allocate a uniformly spaced profile. | |
| void | GenerateTanh (index size, int nvars, real minV, real maxV, real d0) |
| Allocate a tanh-clustered (bilateral) profile. | |
| void | SetZero () |
| Zero both the value matrix and the divisor row vector. | |
| template<class TU > | |
| void | AddSimpleInterval (TU vmean, real divV, real lV, real rV) |
| Accumulate a cell-mean value over the interval [lV, rV]. | |
| void | Reduce () |
| MPI Allreduce (SUM) the value matrix and divisor across all ranks. | |
| Eigen::Vector< real, nVarsFixed > | Get (index i) const |
Retrieve the averaged value for cell i. | |
| Eigen::Vector< real, nVarsFixed > | GetPlain (real v) const |
Linearly interpolate the profile at coordinate v. | |
| void | OutProfileCSV (std::ostream &o, bool title=true, int precision=16) |
| Write the profile to a CSV stream after a valid MPI reduction. | |
Public Attributes | |
| MPIInfo | mpi |
| MPI communicator info. | |
| Eigen::Vector< real, Eigen::Dynamic > | nodes |
| Node coordinates (size = nCells + 1). | |
| Eigen::Matrix< real, nVarsFixed, Eigen::Dynamic > | v |
| Accumulated cell values (nVars × nCells). | |
| Eigen::RowVector< real, Eigen::Dynamic > | div |
| Per-cell divisor (area weight). | |
One-dimensional profile for inlet/outlet boundary data.
Discretizes a 1-D coordinate range into cells delimited by nodes. Supports uniform and tanh (bilateral clustering) node distributions. Cell values are accumulated via AddSimpleInterval(), reduced across MPI ranks with Reduce(), then queried with Get() or interpolated with GetPlain(). The profile can be written to CSV with OutProfileCSV().
The number of cells equals nodes.size() - 1.
| nVarsFixed | Compile-time number of state variables (or Eigen::Dynamic). |
Definition at line 767 of file EulerBC.hpp.
|
inline |
Construct with MPI communicator (no allocation yet).
| _mpi | MPI communicator wrapper. |
Definition at line 776 of file EulerBC.hpp.
|
inline |
Accumulate a cell-mean value over the interval [lV, rV].
Distributes vmean weighted by divV across every profile cell that overlaps [lV, rV], proportional to the overlap fraction.
| TU | Vector type compatible with scalar multiplication and Eigen addition. |
| vmean | Mean state vector for the contributing interval. |
| divV | Divisor (area / weight) for the contributing interval. |
| lV | Left coordinate of the contributing interval. |
| rV | Right coordinate of the contributing interval. |
Definition at line 848 of file EulerBC.hpp.
|
inline |
Allocate a tanh-clustered (bilateral) profile.
| size | Number of cells. |
| nvars | Number of state variables. |
| minV | Left coordinate bound. |
| maxV | Right coordinate bound. |
| d0 | First cell width controlling clustering intensity. |
Definition at line 819 of file EulerBC.hpp.
|
inline |
Allocate a uniformly spaced profile.
| size | Number of cells. |
| nvars | Number of state variables. |
| minV | Left coordinate bound. |
| maxV | Right coordinate bound. |
Definition at line 804 of file EulerBC.hpp.
|
inline |
Retrieve the averaged value for cell i.
Returns v(:, i) / div(i), with a tiny epsilon to avoid division by zero.
| i | Cell index in [0, Size()). |
i. Definition at line 885 of file EulerBC.hpp.
|
inline |
Linearly interpolate the profile at coordinate v.
Locates the cell containing v, then blends the averaged values of that cell and its neighbors to produce a smooth interpolation.
| v | Coordinate at which to evaluate the profile. |
Definition at line 900 of file EulerBC.hpp.
|
inline |
Return the length of cell i (= nodes[i+1] - nodes[i]).
| i | Cell index in [0, Size()). |
Definition at line 792 of file EulerBC.hpp.
|
inline |
Write the profile to a CSV stream after a valid MPI reduction.
Should be called on a single MPI rank. Outputs one row per node coordinate with interpolated values.
| o | Output stream to write CSV data to. |
| title | If true, write a CSV header row first. |
| precision | Floating-point precision for std::scientific output. |
Definition at line 926 of file EulerBC.hpp.
|
inline |
MPI Allreduce (SUM) the value matrix and divisor across all ranks.
Definition at line 868 of file EulerBC.hpp.
|
inline |
Zero both the value matrix and the divisor row vector.
Definition at line 829 of file EulerBC.hpp.
|
inline |
Return the number of cells (= nodes.size() - 1).
Definition at line 785 of file EulerBC.hpp.
|
inline |
Sort node coordinates in ascending order.
Definition at line 779 of file EulerBC.hpp.
| Eigen::RowVector<real, Eigen::Dynamic> DNDS::Euler::OneDimProfile< nVarsFixed >::div |
Per-cell divisor (area weight).
Definition at line 772 of file EulerBC.hpp.
| MPIInfo DNDS::Euler::OneDimProfile< nVarsFixed >::mpi |
MPI communicator info.
Definition at line 769 of file EulerBC.hpp.
| Eigen::Vector<real, Eigen::Dynamic> DNDS::Euler::OneDimProfile< nVarsFixed >::nodes |
Node coordinates (size = nCells + 1).
Definition at line 770 of file EulerBC.hpp.
| Eigen::Matrix<real, nVarsFixed, Eigen::Dynamic> DNDS::Euler::OneDimProfile< nVarsFixed >::v |
Accumulated cell values (nVars × nCells).
Definition at line 771 of file EulerBC.hpp.