Postprocess framework

- Executed has been completed and testd.
- regions multipleSpheres are compelete
- Docs for regions is comelete.
This commit is contained in:
Hamidreza
2025-04-15 21:27:49 +03:30
parent 077f25842a
commit 093160ba32
21 changed files with 762 additions and 171 deletions

View File

@ -26,6 +26,34 @@ Licence:
namespace pFlow
{
/**
* @class centerPointsRegionPoints
* @brief A region points implementation that selects particles based on their IDs
*
* This class is responsible for selecting points (particles) by their IDs from
* a simulation database and tracking their properties. It maintains information
* about the selected particles including their positions, volumes, and diameters.
*
* The selection is performed based on IDs provided in the input dictionary.
* Once selected, the particles' properties can be accessed through various
* methods. The update method allows refreshing the selection when particle data
* changes. The selection occurs at startTime defined in the time control, and
* there are some methods for selecting ids:
* - specifying ids
* - using selectors specified in pStructSelector class, which includes:
* - box: selects particles within a box region
* - sphere: selects particles within a spherical region
* - cylinder: selects particles within a cylindrical region
* - random: randomly selects a specified number of particles
* - strided: selects particles with a specified stride pattern
*
* This class is useful for tracking specific particles of interest throughout
* a simulation and analyzing their behavior.
*
* @see regionPoints Base class providing the interface for different region
* point selections
* @see pStructSelector Class providing different particle selection methods
*/
class centerPointsRegionPoints
:
public regionPoints
@ -59,6 +87,7 @@ private:
public:
/// Type info
TypeInfo("centerPoints");
centerPointsRegionPoints(
@ -67,50 +96,69 @@ public:
~centerPointsRegionPoints() override = default;
/// @brief Returns the number of selected points/particles
/// @return Number of selected points/particles
uint32 size()const override
{
return selectedPoints_.size();
}
/// @brief Checks if there are no selected points
/// @return True if no points are selected, false otherwise
bool empty()const override
{
return selectedPoints_.empty();
}
/// @brief Returns the volumes of the selected points (this is normally not used)
span<const real> volumes()const override
{
return span<const real>(volume_.data(), volume_.size());
}
span<const real> eqDiameters()const override
/// @brief Returns the equivalent diameters of the regions (this is normally not used )
span<const real> eqDiameters()const override
{
return span<const real>(diameter_.data(), diameter_.size());
}
/// @brief Returns the center positions of the selected points
/// @return Span containing the center positions of all selected points
span<const realx3> centers()const override
{
return span<const realx3>(center_.data(), center_.size());
}
/// @brief Returns the indices of the selected points (const version)
/// @param elem Element index (not used in this implementation)
/// @return Span containing the indices of all selected points
span<const uint32> indices(uint32 elem)const override
{
return span<const uint32>(selectedPoints_.data(), selectedPoints_.size());
}
/// @brief Returns the indices of the selected points (non-const version)
/// @param elem Element index (not used in this implementation)
/// @return Span containing the indices of all selected points
span<uint32> indices(uint32 elem) override
{
return span<uint32>(selectedPoints_.data(), selectedPoints_.size());
}
/// @brief update the selected points based on the ids
/// @return true if the operation is successful
/// @brief Updates the selected points based on the particle IDs
/// @return True if the operation is successful, false otherwise
bool update() override;
/// @brief Checks if the data should be written to the same time file
/// @return True if data should be written to the same time file, false otherwise
bool writeToSameTimeFile()const override
{
return true;
}
/// @brief Writes the data to the output stream
/// @param os Output stream
/// @return True if the operation is successful, false otherwise
bool write(iOstream& os)const override;
}; // class centerPointsRegionPoints