mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-07-08 03:07:03 +00:00
PostprocessData update
Modifications on fieldsDataBase to work both during simulation and post-simulation Some bug fixes and changes to the code based Correction for region volume
This commit is contained in:
@ -23,11 +23,13 @@ bool pFlow::centerPointsRegionPoints::selectIds()
|
||||
}
|
||||
}
|
||||
else
|
||||
// TODO: this should be corrected to select ids of particles
|
||||
// that are selected based on the selector (this is visa versa)
|
||||
{
|
||||
auto selectorPtr = pStructSelector::create(
|
||||
selector,
|
||||
database().pStruct(),
|
||||
probDict_);
|
||||
probDict_.subDict(selector+"Info"));
|
||||
auto selectedPoints = selectorPtr->selectedPoints();
|
||||
ids_.resize(selectedPoints.size());
|
||||
ids_.assign(selectedPoints.begin(), selectedPoints.end());
|
||||
|
@ -38,6 +38,7 @@ pFlow::lineRegionPoints::lineRegionPoints
|
||||
sphereRegions_.resize(nPoints, sphere(realx3(0,0,0),1));
|
||||
centerPoints_.resize(nPoints);
|
||||
volumes_.resize(nPoints);
|
||||
diameters_.resize(nPoints);
|
||||
selectedPoints_.resize(nPoints);
|
||||
real dt = 1.0/(nPoints-1);
|
||||
for(uint32 i = 0; i < nPoints; ++i)
|
||||
@ -64,6 +65,21 @@ pFlow::span<const pFlow::uint32> pFlow::lineRegionPoints::indices(uint32 elem) c
|
||||
selectedPoints_[elem].size());
|
||||
}
|
||||
|
||||
pFlow::span<pFlow::uint32> pFlow::lineRegionPoints::indices(uint32 elem)
|
||||
{
|
||||
if(elem >= size())
|
||||
{
|
||||
fatalErrorInFunction
|
||||
<< "The element index is out of range. elem: " << elem
|
||||
<< " size: " << size() << endl;
|
||||
fatalExit;
|
||||
}
|
||||
|
||||
return span<uint32>(
|
||||
selectedPoints_[elem].data(),
|
||||
selectedPoints_[elem].size());
|
||||
}
|
||||
|
||||
bool pFlow::lineRegionPoints::update()
|
||||
{
|
||||
const auto points = database().updatePoints();
|
||||
|
@ -126,6 +126,8 @@ public:
|
||||
|
||||
/// Return indices of points in the specified element/region
|
||||
span<const uint32> indices(uint32 elem)const override;
|
||||
|
||||
span<uint32> indices(uint32 elem) override;
|
||||
|
||||
/// Update regions based on current particle positions
|
||||
bool update() override;
|
||||
|
@ -59,6 +59,20 @@ pFlow::span<const pFlow::uint32> pFlow::multipleSpheresRegionPoints::indices(uin
|
||||
return span<const uint32>(selectedPoints_[elem].data(), selectedPoints_[elem].size());
|
||||
}
|
||||
|
||||
pFlow::span<pFlow::uint32> pFlow::multipleSpheresRegionPoints::indices(uint32 elem)
|
||||
{
|
||||
if (elem >= size())
|
||||
{
|
||||
fatalErrorInFunction
|
||||
<< "The element index is out of range. elem: " << elem
|
||||
<< " size: " << size() << endl;
|
||||
fatalExit;
|
||||
}
|
||||
|
||||
return span<uint32>(selectedPoints_[elem].data(), selectedPoints_[elem].size());
|
||||
}
|
||||
|
||||
|
||||
bool pFlow::multipleSpheresRegionPoints::update()
|
||||
{
|
||||
const auto points = database().updatePoints();
|
||||
|
@ -138,6 +138,11 @@ public:
|
||||
/// @return Span containing indices of particles within the specified region
|
||||
span<const uint32> indices(uint32 elem)const override;
|
||||
|
||||
/// Returns the indices of particles contained in a specific spherical region
|
||||
/// @param elem Index of the spherical region to query
|
||||
/// @return Span containing indices of particles within the specified region
|
||||
span<uint32> indices(uint32 elem) override;
|
||||
|
||||
/// Updates the selection of particles within each spherical region
|
||||
/// @return True if update was successful, false otherwise
|
||||
bool update() override;
|
||||
|
Reference in New Issue
Block a user