mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-07-18 03:17:04 +00:00
Postprocess framework
- Executed has been completed and testd. - regions multipleSpheres are compelete - Docs for regions is comelete.
This commit is contained in:
@ -18,14 +18,42 @@ Licence:
|
||||
|
||||
-----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* @class lineRegionPoints
|
||||
* @brief Spherical regions along a line for selecting points/particles
|
||||
*
|
||||
* The lineRegionPoints class is responsible for selecting points/particles along a
|
||||
* specified line and creating sphere regions around those points. It partitions
|
||||
* the line into multiple sphere regions (equally spaced) and keeps track of
|
||||
* which points/particles in the simulation fall into each region.
|
||||
*
|
||||
* This class is used for post-processing data by analyzing distributions of
|
||||
* particles along a linear path through the simulation domain. It maintains:
|
||||
* - A line defining the sampling path
|
||||
* - Spherical regions along this line that include particles
|
||||
* - Center points for each region
|
||||
* - Volumes and diameters of regions
|
||||
* - Indices of points/particles contained in each region
|
||||
*
|
||||
* The regions can be updated as the simulation progresses, and the data
|
||||
* can be written to output for analysis.
|
||||
*
|
||||
* @see regionPoints
|
||||
* @see line
|
||||
* @see sphere
|
||||
* @see fieldsDataBase
|
||||
*/
|
||||
|
||||
#ifndef __lineRegionPoints_hpp__
|
||||
#define __lineRegionPoints_hpp__
|
||||
|
||||
|
||||
#include "regionPoints.hpp"
|
||||
#include "line.hpp"
|
||||
#include "sphere.hpp"
|
||||
#include "Vectors.hpp"
|
||||
|
||||
|
||||
namespace pFlow
|
||||
{
|
||||
|
||||
@ -35,68 +63,80 @@ class lineRegionPoints
|
||||
{
|
||||
private:
|
||||
|
||||
/// line region for selecting points
|
||||
/// Line path defining the axis of the spherical regions
|
||||
line line_;
|
||||
|
||||
/// all sphere regions
|
||||
/// Collection of sphere regions along the line
|
||||
Vector<sphere> sphereRegions_;
|
||||
|
||||
/// center poitns of regions/elements
|
||||
/// Center points of all spherical regions
|
||||
realx3Vector centerPoints_;
|
||||
|
||||
/// volumes of all elements/regions
|
||||
/// Volumes of all spherical regions
|
||||
realVector volumes_;
|
||||
|
||||
/// Diameters of all spherical regions
|
||||
realVector diameters_;
|
||||
|
||||
/// the point indices that are selected by this region
|
||||
/// Point/particles indices selected by each region
|
||||
Vector<uint32Vector> selectedPoints_;
|
||||
|
||||
public:
|
||||
|
||||
/// Type information for runtime type identification
|
||||
TypeInfo(line::TYPENAME());
|
||||
|
||||
/// Construct from dictionary that contains lineInfo and fields database
|
||||
lineRegionPoints(
|
||||
const dictionary& dict,
|
||||
fieldsDataBase& fieldsDataBase);
|
||||
|
||||
/// Default destructor
|
||||
~lineRegionPoints() override = default;
|
||||
|
||||
/// Return number of regions
|
||||
uint32 size()const override
|
||||
{
|
||||
return sphereRegions_.size();
|
||||
}
|
||||
|
||||
/// Check if regions list is empty
|
||||
bool empty()const override
|
||||
{
|
||||
return sphereRegions_.empty();
|
||||
}
|
||||
|
||||
/// Return volumes of all regions
|
||||
span<const real> volumes()const override
|
||||
{
|
||||
return span<const real>(volumes_.data(), volumes_.size());
|
||||
}
|
||||
|
||||
/// Return equivalent diameters of all regions
|
||||
span<const real> eqDiameters()const override
|
||||
{
|
||||
return span<const real>(diameters_.data(), diameters_.size());
|
||||
}
|
||||
|
||||
/// Return center points of all regions
|
||||
span<const realx3> centers()const override
|
||||
{
|
||||
return span<const realx3>(centerPoints_.data(), centerPoints_.size());
|
||||
}
|
||||
|
||||
/// Return indices of points in the specified element/region
|
||||
span<const uint32> indices(uint32 elem)const override;
|
||||
|
||||
|
||||
/// Update regions based on current particle positions
|
||||
bool update() override;
|
||||
|
||||
/// Whether to write all data to the same time file
|
||||
bool writeToSameTimeFile()const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Write data to output stream
|
||||
bool write(iOstream& os) const override;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user