10 Commits

Author SHA1 Message Date
21a7d0ab4d minor changes in readmd.md of postProcessing 2025-05-22 12:46:11 +03:30
c89a297e6f centerPoint enhanced & DEMsystem modified for id
- center points enhanced to select particle ids based on the particles located in box, sphere and cylinder
- readme.md modified
- DEMsystem is modified to pass id
2025-05-22 09:37:07 +03:30
832d1fb16b Merge branch 'main' of github.com:PhasicFlow/phasicFlow 2025-05-19 13:54:03 +03:30
e8ee35791f minor changes after MPI merge 2025-05-19 13:53:34 +03:30
a570432f84 Merge pull request #227 from wanqing0421/boxMesh
add box region for postprocess
2025-05-19 11:23:53 +03:30
0e4a041ffb Update volume boxRegionPoints.cpp 2025-05-19 11:21:26 +03:30
51c6f925d8 add box region 2025-05-18 21:50:37 +08:00
9fb8abb166 Merge branch 'main' of github.com:PhasicFlow/phasicFlow 2025-05-16 19:18:31 +03:30
90a8fff673 Merge pull request #226 from PhasicFlow/local-MPI
Local mpi
2025-05-16 19:17:24 +03:30
a05225ce53 Merge branch 'main' of github.com:PhasicFlow/phasicFlow 2025-05-16 19:15:17 +03:30
27 changed files with 452 additions and 91 deletions

View File

@ -66,12 +66,13 @@ pFlow::uniquePtr<pFlow::DEMSystem>
word demSystemName,
const std::vector<box>& domains,
int argc,
char* argv[]
char* argv[],
bool requireRVel
)
{
if( wordvCtorSelector_.search(demSystemName) )
{
return wordvCtorSelector_[demSystemName] (demSystemName, domains, argc, argv);
return wordvCtorSelector_[demSystemName] (demSystemName, domains, argc, argv, requireRVel);
}
else
{

View File

@ -71,13 +71,15 @@ public:
word demSystemName,
const std::vector<box>& domains,
int argc,
char* argv[]
char* argv[],
bool requireRVel
),
(
demSystemName,
domains,
argc,
argv
argv,
requireRVel
));
realx3 g()const
@ -119,7 +121,10 @@ public:
span<const int32> parIndexInDomain(int32 domIndx)const = 0;
virtual
span<real> diameter() = 0;
span<real> diameter() = 0;
virtual
span<uint32> particleId() = 0;
virtual
span<real> courseGrainFactor() = 0;
@ -176,7 +181,8 @@ public:
word demSystemName,
const std::vector<box>& domains,
int argc,
char* argv[]);
char* argv[],
bool requireRVel=false);
};

View File

@ -163,6 +163,12 @@ pFlow::grainDEMSystem::parIndexInDomain(int32 di)const
return particleDistribution_->particlesInDomain(di);
}
pFlow::span<pFlow::uint32> pFlow::grainDEMSystem::particleId()
{
return span<uint32>(particleIdHost_.data(), particleIdHost_.size());
}
pFlow::span<pFlow::real> pFlow::grainDEMSystem::diameter()
{
return span<real>(diameterHost_.data(), diameterHost_.size());
@ -233,6 +239,7 @@ bool pFlow::grainDEMSystem::beforeIteration()
velocityHost_ = std::as_const(particles_()).velocity().hostView();
positionHost_ = std::as_const(particles_()).pointPosition().hostView();
diameterHost_ = particles_->diameter().hostView();
particleIdHost_ = particles_->particleId().hostView();
if(requireRVel_)
rVelocityHost_ = std::as_const(particles_()).rVelocity().hostView();

View File

@ -63,6 +63,8 @@ protected:
ViewType1D<real, HostSpace> diameterHost_;
ViewType1D<uint32, HostSpace> particleIdHost_;
bool requireRVel_ = false;
ViewType1D<realx3, HostSpace> rVelocityHost_;
@ -122,6 +124,8 @@ public:
span<const int32> parIndexInDomain(int32 di)const override;
span<uint32> particleId() override;
span<real> diameter() override;
span<real> courseGrainFactor() override;

View File

@ -165,6 +165,11 @@ pFlow::sphereDEMSystem::parIndexInDomain(int32 di)const
return particleDistribution_->particlesInDomain(di);
}
pFlow::span<pFlow::uint32> pFlow::sphereDEMSystem::particleId()
{
return span<uint32>();
}
pFlow::span<pFlow::real> pFlow::sphereDEMSystem::diameter()
{
return span<real>(diameterHost_.data(), diameterHost_.size());
@ -235,6 +240,7 @@ bool pFlow::sphereDEMSystem::beforeIteration()
velocityHost_ = std::as_const(particles_()).velocity().hostView();
positionHost_ = std::as_const(particles_()).pointPosition().hostView();
diameterHost_ = particles_->diameter().hostView();
particleIdHost_ = particles_->particleId().hostView();
if(requireRVel_)
rVelocityHost_ = std::as_const(particles_()).rVelocity().hostView();

View File

@ -63,6 +63,8 @@ protected:
ViewType1D<real, HostSpace> diameterHost_;
ViewType1D<uint32, HostSpace> particleIdHost_;
bool requireRVel_ = false;
ViewType1D<realx3, HostSpace> rVelocityHost_;
@ -122,6 +124,8 @@ public:
span<const int32> parIndexInDomain(int32 di)const override;
span<uint32> particleId() override;
span<real> diameter() override;
span<real> courseGrainFactor() override;

View File

@ -26,7 +26,7 @@ bool pFlow::processorBoundarySphereParticles::acceleration(const timeInfo &ti, c
auto I = Particles().I().BoundaryField(thisIndex).neighborProcField().deviceView();
auto cf = Particles().contactForce().BoundaryField(thisIndex).neighborProcField().deviceView();
auto ct = Particles().contactTorque().BoundaryField(thisIndex).neighborProcField().deviceView();
auto acc = Particles().accelertion().BoundaryField(thisIndex).neighborProcField().deviceView();
auto acc = Particles().acceleration().BoundaryField(thisIndex).neighborProcField().deviceView();
auto rAcc = Particles().rAcceleration().BoundaryField(thisIndex).neighborProcField().deviceView();
Kokkos::parallel_for(

View File

@ -185,6 +185,18 @@ public:
return contactTorque_;
}
inline
uint32PointField_D& particleId()
{
return idHandler_();
}
inline
const uint32PointField_D& particleId() const
{
return idHandler_();
}
inline
uint32 maxId()const
{

View File

@ -9,6 +9,7 @@ set(SourceFiles
# Regions
region/regionPoints/regionPoints/regionPoints.cpp
region/regionPoints/sphereRegionPoints/sphereRegionPoints.cpp
region/regionPoints/boxRegionPoints/boxRegionPoints.cpp
region/regionPoints/lineRegionPoints/lineRegionPoints.cpp
region/regionPoints/centerPointsRegionPoints/centerPointsRegionPoints.cpp
region/regionPoints/multipleSpheresRegionPoints/multipleSpheresRegionPoints.cpp

View File

@ -5,15 +5,14 @@ The `PostprocessData` module in phasicFlow provides powerful tools for analyzing
- in-simulation: this is postprocessing that is active during simulation. When running a solver, it allows for real-time data analysis and adjustments based on the simulation's current state. See below to see how you can activate in-simulation postprocessing.
- post-simulation: this is postprocessing that is done after the simulation is completed. It allows for detailed analysis of the simulation results, including data extraction and visualization based on the results that are stored in time-folders. If you want to use post-simulation, you need to run utility `postprocessPhasicFlow` in terminal (in the simulation case setup folder) to run the postprocessing. This utility reads the `postprocessDataDict` file and performs the specified operations on the simulation data.
## 1. Overview
Postprocessing in phasicFlow allows you to:
### Important Notes
- Extract information about particles in specific regions of the domain
- Calculate statistical properties such as averages and sums of particle attributes
- Track specific particles throughout the simulation
- Apply different weighing methods when calculating statistics
- Perform postprocessing at specific time intervals
* **NOTE 1:**
postprocessing for in-simulation, is not implemented for MPI execution. So, do not use it when using MPI execution. For post-simulation postprocessing, you can use the `postprocessPhasicFlow` utility without MPI, even though the actual simulation has been done using MPI.
* **NOTE 2:**
In post-simulation mode, all timeControl settings are ignored. The postprocessing will be done for all the time folders that are available in the case directory or if you specify the time range in the command line, the postprocessing will be done for the time folders that are in the specified range of command line.
## Table of Contents
@ -40,6 +39,16 @@ Postprocessing in phasicFlow allows you to:
- [9. Mathematical Formulations](#9-mathematical-formulations)
- [10. A complete dictionary file (postprocessDataDict)](#10-a-complete-dictionary-file-postprocessdatadict)
## 1. Overview
Postprocessing in phasicFlow allows you to:
- Extract information about particles in specific regions of the domain
- Calculate statistical properties such as averages and sums of particle attributes
- Track specific particles throughout the simulation
- Apply different weighing methods when calculating statistics
- Perform postprocessing at specific time intervals
## 2. Setting Up Postprocessing
Postprocessing is configured through a dictionary file named `postprocessDataDict` which should be placed in the `settings` directory. Below is a detailed explanation of the configuration options.
@ -118,12 +127,17 @@ Regions define where in the domain the postprocessing operations are applied:
| Region Type | Description | Required Parameters | Compatible with |
|-------------|-------------|---------------------|-----------------|
| `sphere` | A spherical region | `radius`, `center` | bulk |
| `multipleSpheres` | Multiple spherical regions | `centers`, `radii` | bulk |
| `line` | Spheres along a line with specified radius | `p1`, `p2`, `nSpheres`, `radius` | bulk |
| `centerPoints` | Specific particles selected by ID | `ids` | individual |
| `sphere` | A spherical region | `radius`, `center` defined in `sphereInfo` dict| bulk |
| `multipleSpheres` | Multiple spherical regions | `centers`, `radii` defined in `multiplSpheresInfo` dict | bulk |
| `line` | Spheres along a line with specified radius | `p1`, `p2`, `nSpheres`, `radius` defined in `lineInfo` dict| bulk |
| `box`| A cuboid region | `min`, `max` defined in `boxInfo` dict | bulk |
| `centerPoints`* | Specific particles selected by ID | `ids` | individual |
| `centerPoints`* | Specific particles selected by center points located in a box | `boxInfo` | individual |
| `centerPoints`* | Specific particles selected by center points located in a sphere | `sphereInfo` | individual |
| `centerPoints`* | Specific particles selected by center points located in a cylinder | `cylinderInfo` | individual |
| <td colspan="4">\* Particles selection is done when simulation reaches the time that is specified by `startTime` of the post-process component and this selection remains intact up to the end of simulation. This is very good for particle tracking purposes or when you want to analyze specific particles behavior over time.</td> |
## 6. Processing Operations
## 6. Processing Operations for Bulk Properties
Within each processing region of type `bulk`, you can define multiple operations to be performed:
@ -447,7 +461,7 @@ components
processMethod particleProbe;
processRegion centerPoints;
selector id;
field component(position,y);
field component(velocity,y);
ids (0 10 100);
timeControl default; // other options are settings, timeStep, simulationTime
// settings: uses parameters from settingsDict file
@ -456,6 +470,35 @@ components
// default: uses the default time control (defined in defaultTimeControl).
// default behavior: if you do not specify it, parameters in defaultTimeControl is used.
}
particlesTrack
{
processMethod particleProbe;
processRegion centerPoints;
// all particles whose ceters are located inside this box
// are selected. Selection occurs at startTime: particles
// that are inside the box at t = startTime.
selector box;
boxInfo
{
min (0 0 0);
max (0.1 0.05 0.05);
}
// center position of selected particles are processed
field position;
timeControl simulationTime;
// execution starts at 1.0 s
startTime 1.0;
// execution ends at 10 s
endTime 10;
// execution interval of this compoenent
executionInterval 0.02;
}
on_single_sphere
{
@ -565,5 +608,4 @@ components
}
);
```

View File

@ -0,0 +1,52 @@
#include "boxRegionPoints.hpp"
#include "fieldsDataBase.hpp"
#include "numericConstants.hpp"
namespace pFlow::postprocessData
{
boxRegionPoints::boxRegionPoints
(
const dictionary &dict,
fieldsDataBase &fieldsDataBase
)
:
regionPoints(dict, fieldsDataBase),
boxRegion_(dict.subDict("boxInfo")),
volume_
(
(boxRegion_.maxPoint().x() - boxRegion_.minPoint().x()) *
(boxRegion_.maxPoint().y() - boxRegion_.minPoint().y()) *
(boxRegion_.maxPoint().z() - boxRegion_.minPoint().z())
),
diameter_(2 * pow(3 * volume_ / 4.0 / Pi, 1.0 / 3.0)),
selectedPoints_("selectedPoints")
{
}
bool boxRegionPoints::update()
{
const auto points = database().updatePoints();
selectedPoints_.clear();
for(uint32 i = 0; i < points.size(); ++i)
{
if( boxRegion_.isInside(points[i]))
{
selectedPoints_.push_back(i);
}
}
return true;
}
bool boxRegionPoints::write(iOstream &os) const
{
os <<"# Single box\n";
os <<"# min point: "<< boxRegion_.minPoint() <<endl;
os <<"# max point: "<< boxRegion_.maxPoint() << endl;
os <<"time"<< tab <<"value"<<endl;
return true;
}
} // End namespace pFlow::postprocessData

View File

@ -0,0 +1,171 @@
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
/**
* @file boxRegionPoints.hpp
* @brief A class representing a box region for point selection
*
* This class provides functionality to select points within a box region
* and to compute related properties such as volume and equivalent diameter.
* It inherits from regionPoints and implements all required virtual methods.
*
* @see regionPoints
* @see box
* @see fieldsDataBase
*/
#ifndef __boxRegionPoints_hpp__
#define __boxRegionPoints_hpp__
#include "regionPoints.hpp"
#include "box.hpp"
#include "Vectors.hpp"
namespace pFlow::postprocessData
{
class boxRegionPoints
:
public regionPoints
{
private:
/// box object defining the region for point selection
box boxRegion_;
/// Volume of the box region
real volume_;
/// Diameter of the box region
real diameter_;
/// Indices of points that are selected by this region
uint32Vector selectedPoints_;
public:
TypeInfo(box::TYPENAME());
/**
* @brief Construct a box region for point selection
*
* @param dict Dictionary containing boxInfo dictionary
* @param fieldsDataBase Database containing fields data
*/
boxRegionPoints(
const dictionary& dict,
fieldsDataBase& fieldsDataBase);
/// Destructor
~boxRegionPoints() override = default;
/**
* @brief Get the number of regions (always 1 for box)
* @return Always returns 1
*/
uint32 size()const override
{
return 1;
}
/**
* @brief Check if the region is empty
* @return Always returns false
*/
bool empty()const override
{
return false;
}
/**
* @brief Get the volume of the box region
* @return A span containing the volume of the region
*/
span<const real> volumes()const override
{
return span<const real>(&volume_, 1);
}
/**
* @brief Get the equivalent diameter of the box region
* @return A span containing the diameter of the region
*/
span<const real> eqDiameters()const override
{
return span<const real>(&diameter_, 1);
}
/**
* @brief Get the center of the box region
* @return A span containing the center point of the region
*/
span<const realx3> centers()const override
{
realx3 center = 0.5 * (boxRegion_.minPoint() + boxRegion_.maxPoint());
return span<const realx3>(&center, 1);
}
/**
* @brief Get the indices of points within the region (const version)
* @param elem Element index (ignored as there's only one box)
* @return A span containing indices of points within the region
*/
span<const uint32> indices(uint32 elem)const override
{
return span<const uint32>(selectedPoints_.data(), selectedPoints_.size());
}
/**
* @brief Get the indices of points within the region (non-const version)
* @param elem Element index (ignored as there's only one box)
* @return A span containing indices of points within the region
*/
span<uint32> indices(uint32 elem) override
{
return span<uint32>(selectedPoints_.data(), selectedPoints_.size());
}
/**
* @brief Update the points selected by this region
* @return True if update was successful
*/
bool update()override;
/**
* @brief Determine if data should be written to the same time file
* @return Always returns true
*/
bool writeToSameTimeFile()const override
{
return true;
}
/**
* @brief Write region data to output stream
* @param os Output stream to write to
* @return True if write was successful
*/
bool write(iOstream& os)const override;
};
}
#endif // __boxRegionPoints_hpp__

View File

@ -8,6 +8,8 @@ namespace pFlow::postprocessData
bool centerPointsRegionPoints::selectIds()
{
// check if it is already found the ids of particles
// if not, then find the ids of particles
if(!firstTimeUpdate_) return true;
firstTimeUpdate_ = false;
@ -26,16 +28,20 @@ bool 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_.subDict(selector+"Info"));
auto selectedPoints = selectorPtr->selectedPoints();
ids_.resize(selectedPoints.size());
ids_.assign(selectedPoints.begin(), selectedPoints.end());
const auto& idField = database().updateFieldUint32(idName_);
ids_.clear();
ids_.reserve(selectedPoints.size());
for( auto& pntIndex: selectedPoints)
{
ids_.push_back(idField[pntIndex]);
}
}
volume_.resize(ids_.size(),1.0);
@ -62,11 +68,12 @@ bool centerPointsRegionPoints::update()
const auto& idField = database().updateFieldUint32(idName_);
selectedPoints_.fill(-1);
for(uint32 i = 0; i < idField.size(); ++i)
for( uint32 j=0; j< ids_.size(); ++j)
{
for( uint32 j=0; j< ids_.size(); ++j)
auto id = ids_[j];
for( uint32 i=0; i< idField.size(); i++)
{
if(idField[i] == ids_[j])
if(idField[i] == id)
{
selectedPoints_[j] = i;
break;

View File

@ -36,7 +36,7 @@ components
processMethod particleProbe;
processRegion centerPoints;
selector id;
field component(position,y);
field component(velocity,y);
ids (0 10 100);
timeControl default; // other options are settings, timeStep, simulationTime
// settings: uses parameters from settingsDict file
@ -45,6 +45,35 @@ components
// default: uses the default time control (defined in defaultTimeControl).
// default behavior: if you do not specify it, parameters in defaultTimeControl is used.
}
particlesTrack
{
processMethod particleProbe;
processRegion centerPoints;
// all particles whose ceters are located inside this box
// are selected. Selection occurs at startTime: particles
// that are inside the box at t = startTime.
selector box;
boxInfo
{
min (0 0 0);
max (0.1 0.05 0.05);
}
// center position of selected particles are processed
field position;
timeControl simulationTime;
// execution starts at 1.0 s
startTime 1.0;
// execution ends at 10 s
endTime 10;
// execution interval of this compoenent
executionInterval 0.02;
}
on_single_sphere
{

View File

@ -16,7 +16,7 @@ template class pFlow::MPI::dataIOMPI<pFlow::uint32x3>;
template class pFlow::MPI::dataIOMPI<pFlow::uint64>;
template class pFlow::MPI::dataIOMPI<pFlow::size_t>;
//template class pFlow::MPI::dataIOMPI<pFlow::size_t>;
template class pFlow::MPI::dataIOMPI<pFlow::real>;

View File

@ -24,9 +24,9 @@ Licence:
#include "scatteredMasterDistribute.hpp"
#include "scatteredMasterDistributeChar.hpp"
pFlow::MPI::MPISimulationDomain::MPISimulationDomain(systemControl& control)
pFlow::MPI::MPISimulationDomain::MPISimulationDomain(systemControl& control, real maxBSphere)
:
simulationDomain(control),
simulationDomain(control, maxBSphere),
communication_(pFlowProcessors()),
subDomainsAll_(pFlowProcessors()),
numPointsAll_(pFlowProcessors()),

View File

@ -61,7 +61,7 @@ public:
TypeInfo("simulationDomain<MPI>");
explicit MPISimulationDomain(systemControl& control);
explicit MPISimulationDomain(systemControl& control, real maxBSphere);
~MPISimulationDomain() final = default;

View File

@ -47,7 +47,7 @@ pFlow::MPI::processorBoundaryField<T, MemorySpace>::updateBoundary(
)
{
#ifndef BoundaryModel1
if(!this->boundary().performBoundarytUpdate())
if(!this->boundary().performBoundaryUpdate())
return true;
#endif
@ -128,21 +128,19 @@ const typename pFlow::MPI::processorBoundaryField<T, MemorySpace>::
template<class T, class MemorySpace>
bool pFlow::MPI::processorBoundaryField<T, MemorySpace>::hearChanges(
real t,
real dt,
uint32 iter,
const timeInfo & ti,
const message& msg,
const anyList& varList
)
{
BoundaryFieldType::hearChanges(t,dt,iter, msg,varList);
if(msg.equivalentTo(message::BNDR_PROC_SIZE_CHANGED))
{
auto newProcSize = varList.getObject<uint32>("size");
auto newProcSize = varList.getObject<uint32>(
message::eventName(message::BNDR_PROC_SIZE_CHANGED));
neighborProcField_.resize(newProcSize);
}
if(msg.equivalentTo(message::BNDR_PROCTRANSFER_SEND))
else if(msg.equivalentTo(message::BNDR_PROCTRANSFER_SEND))
{
const auto& indices = varList.getObject<uint32Vector_D>(
message::eventName(message::BNDR_PROCTRANSFER_SEND)
@ -169,7 +167,6 @@ bool pFlow::MPI::processorBoundaryField<T, MemorySpace>::hearChanges(
thisFieldInNeighbor_.sendData(pFlowProcessors(),transferData);
}
}
else if(msg.equivalentTo(message::BNDR_PROCTRANSFER_RECIEVE))
{
@ -182,30 +179,38 @@ bool pFlow::MPI::processorBoundaryField<T, MemorySpace>::hearChanges(
{
uint32 numRecieved = neighborProcField_.waitBufferForUse();
if(msg.equivalentTo(message::CAP_CHANGED))
if(numRecieved == 0u)
{
auto newCap = varList.getObject<uint32>(
message::eventName(message::CAP_CHANGED));
this->internal().field().reserve(newCap);
return true;
}
if(msg.equivalentTo(message::SIZE_CHANGED))
if(msg.equivalentTo(message::RANGE_CHANGED))
{
auto newSize = varList.getObject<uint32>(
message::eventName(message::SIZE_CHANGED));
this->internal().field().resize(newSize);
auto newRange = varList.getObject<rangeU32>(
message::eventName(message::RANGE_CHANGED));
this->internal().field().resize(newRange.end());
}
const auto& indices = varList.getObject<uint32IndexContainer>(
message::eventName(message::ITEM_INSERT));
this->internal().field().insertSetElement(indices, neighborProcField_.buffer().deviceView());
return true;
if(msg.equivalentTo(message::ITEMS_INSERT))
{
const auto& indices = varList.getObject<uint32IndexContainer>(
message::eventName(message::ITEMS_INSERT));
this->internal().field().insertSetElement(
indices,
neighborProcField_.buffer().deviceView());
}
}
else
{
if(!BoundaryFieldType::hearChanges(ti, msg,varList) )
{
return false;
}
}
return true;
}
template <class T, class MemorySpace>
void pFlow::MPI::processorBoundaryField<T, MemorySpace>::sendBackData() const

View File

@ -91,9 +91,7 @@ public:
}
bool hearChanges(
real t,
real dt,
uint32 iter,
const timeInfo & ti,
const message& msg,
const anyList& varList
) override;

View File

@ -83,15 +83,15 @@ pFlow::MPI::boundaryProcessor::beforeIteration(
else if(step == 2 )
{
#ifdef BoundaryModel1
callAgain = true;
#else
if(!performBoundarytUpdate())
{
callAgain = false;
return true;
}
#endif
#ifdef BoundaryModel1
callAgain = true;
#else
if(!performBoundaryUpdate())
{
callAgain = false;
return true;
}
#endif
thisNumPoints_ = size();
@ -136,7 +136,7 @@ pFlow::MPI::boundaryProcessor::beforeIteration(
varList.emplaceBack(msg.addAndName(message::BNDR_PROC_SIZE_CHANGED), neighborProcNumPoints_);
if( !notify(ti.iter(), ti.t(), ti.dt(), msg, varList) )
if( !notify(ti, msg, varList) )
{
fatalErrorInFunction;
callAgain = false;
@ -343,8 +343,9 @@ bool pFlow::MPI::boundaryProcessor::transferData(
neighborProcPoints_.waitBufferForUse();
internal().insertPointsOnly(neighborProcPoints_.buffer(), msg, varList);
const auto& indices = varList.getObject<uint32IndexContainer>(message::eventName(message::ITEM_INSERT));
const auto& indices = varList.getObject<uint32IndexContainer>(message::eventName(message::ITEMS_INSERT));
// creates a view (does not copy data)
auto indView = deviceViewType1D<uint32>(indices.deviceView().data(), indices.deviceView().size());
uint32Vector_D newIndices("newIndices", indView);
@ -356,7 +357,7 @@ bool pFlow::MPI::boundaryProcessor::transferData(
return false;
}
const auto ti = internal().time().TimeInfo();
const auto& ti = internal().time().TimeInfo();
if(!notify(ti, msg, varList))
{
fatalErrorInFunction;

View File

@ -114,8 +114,8 @@ public:
return true;
}
fatalErrorInFunction<<"Event"<< msg.eventNames()<<"with code "<< msg <<
" is not handled in boundaryField."<<endl;
fatalErrorInFunction<<"Event "<< msg.eventNames()<<" with code "<< msg <<
" is not handled in boundaryField "<< name()<<endl;
return false;
}

View File

@ -223,7 +223,7 @@ bool pFlow::internalField<T, MemorySpace>:: hearChanges
else
{
fatalErrorInFunction<<"hear changes in internal field is not processing "<<
message::eventName(message::RANGE_CHANGED)<<
msg.eventNames()<<
" event with message code "<< msg<<endl;
return false;
}

View File

@ -25,8 +25,8 @@ template class pFlow::dataIORegular<pFlow::uint32x3>;
template class pFlow::dataIO<pFlow::uint64>;
template class pFlow::dataIORegular<pFlow::uint64>;
template class pFlow::dataIO<size_t>;
template class pFlow::dataIORegular<size_t>;
//template class pFlow::dataIO<size_t>;
//template class pFlow::dataIORegular<size_t>;
template class pFlow::dataIO<pFlow::real>;
template class pFlow::dataIORegular<pFlow::real>;

View File

@ -246,7 +246,7 @@ public:
/// Is this iter the right time for updating bounday list
inline
bool performBoundarytUpdate()const
bool performBoundaryUpdate()const
{
return updateTime_;
}

View File

@ -60,7 +60,7 @@ bool pFlow::boundaryExit::beforeIteration
{
callAgain = false;
if( !performBoundarytUpdate())
if( !performBoundaryUpdate())
{
return true;
}

View File

@ -60,7 +60,7 @@ bool pFlow::boundaryPeriodic::beforeIteration(
return true;
}
//output<<this->thisBoundaryIndex()<<" ->"<<ti.iter()<<" update called\n";
if(!performBoundarytUpdate())
if(!performBoundaryUpdate())
{
return true;
}

View File

@ -1,18 +1,33 @@
#!/bin/bash
cd ${0%/*} || exit 1 # Run from this directory
rm -rf build/ include/ lib/
mkdir build
# Source the configurations - if there's a ./configurations file
[ -f ./configurations ] && source ./configurations
# Set environment variables to ensure shared library creation
export CFLAGS="-fPIC"
export CXXFLAGS="-fPIC"
export FCFLAGS="-fPIC"
# Create build directory
mkdir -p build
cd build
../configure \
--prefix=$HOME/PhasicFlow/phasicFlow-v-1.0/thirdParty/Zoltan/ \
--with-gnumake \
--with-id-type=uint
--disable-tests
--disable-examples
# Run configure with shared library options
echo "Running configure with options to build shared library..."
../configure --prefix=$PWD/.. --enable-shared --disable-static
make everything -j4
# Run make and install
echo "Building and installing Zoltan..."
make install
cd ../
# Convert static to shared library if static library exists and shared doesn't
echo "Checking for static library and converting to shared if needed..."
if [ -f "$PWD/../lib/libzoltan.a" ] && [ ! -f "$PWD/../lib/libzoltan.so" ]; then
echo "Converting static library to shared library..."
cd $PWD/../lib
gcc -shared -o libzoltan.so -Wl,--whole-archive libzoltan.a -Wl,--no-whole-archive
echo "Shared library created as libzoltan.so"
fi
echo "Build completed"