bug resolve, chekcForCollision is set to true for always, adjustable search box is set to false for always, old hearChanges has been removed

This commit is contained in:
HRN 2025-02-07 23:12:53 +03:30
parent 02e0b72082
commit b9ab015eb1
12 changed files with 43 additions and 24 deletions

View File

@ -46,7 +46,7 @@ pFlow::NBS::NBS
diam), diam),
sizeRatio_(max(dict.getVal<real>("sizeRatio"), one)), sizeRatio_(max(dict.getVal<real>("sizeRatio"), one)),
cellExtent_(max(dict.getVal<real>("cellExtent"), half)), cellExtent_(max(dict.getVal<real>("cellExtent"), half)),
adjustableBox_(dict.getVal<Logical>("adjustableBox")), adjustableBox_(false),//adjustableBox_(dict.getVal<Logical>("adjustableBox")),
NBSLevel0_ NBSLevel0_
( (
this->domainBox_, this->domainBox_,

View File

@ -23,7 +23,7 @@ Licence:
#include "streams.hpp" #include "streams.hpp"
pFlow::uint32 pFlow::mapperNBS::checkInterval_ = 1000; pFlow::uint32 pFlow::mapperNBS::checkInterval_ = 1000;
pFlow::real pFlow::mapperNBS::enlargementFactor_ = 1.1; pFlow::real pFlow::mapperNBS::enlargementFactor_ = 1.5;
bool pFlow::mapperNBS::setSearchBox bool pFlow::mapperNBS::setSearchBox
( (

View File

@ -161,10 +161,13 @@ public:
const anyList& varList const anyList& varList
) override ) override
{ {
if(msg.equivalentTo(message::BNDR_RESET))
{
// do nothing
return true;
}
pOutput<<"Function (hearChanges in boundarySphereInteractions)is not implmented Message "<< pOutput<<"Function (hearChanges in boundarySphereInteractions)is not implmented Message "<<
msg <<endl<<" name "<< this->boundaryName() <<" type "<< this->type()<<endl; msg <<endl<<" name "<< this->boundaryName() <<" type "<< this->type()<<endl;
//notImplementedFunction;
return true; return true;
} }

View File

@ -81,7 +81,7 @@ pFlow::insertion::readInsertionDict()
if (active_) if (active_)
{ {
checkForCollision_ = getVal<Logical>("checkForCollision"); //checkForCollision_ = getVal<Logical>("checkForCollision");
REPORT(1) << "Particle insertion mechanism is " << Yellow_Text("active") REPORT(1) << "Particle insertion mechanism is " << Yellow_Text("active")
<< " in the simulation." << END_REPORT; << " in the simulation." << END_REPORT;

View File

@ -42,7 +42,7 @@ private:
Logical active_ = "No"; Logical active_ = "No";
/// Check for collision? It is not active now /// Check for collision? It is not active now
Logical checkForCollision_ = "No"; Logical checkForCollision_ = "Yes";
/// if increase velocity in case particles are failed /// if increase velocity in case particles are failed
/// to be inserted due to collision /// to be inserted due to collision

View File

@ -179,7 +179,17 @@ public:
"list of variables is \n"<<names_<<endl; "list of variables is \n"<<names_<<endl;
return false; return false;
} }
return getTypeName<T>() != types_[i]; return getTypeName<T>() == types_[i];
}
word getObjectTypeName(const word& name)const
{
int32 i = names_.findi(name);
if(i == -1 )
{
return "NAME_NOT_FOUND";
}
return types_[i];
} }
/// Get the const reference to variable by name /// Get the const reference to variable by name

View File

@ -194,7 +194,9 @@ bool pFlow::internalField<T, MemorySpace>:: hearChanges
auto varName = message::eventName(message::RANGE_CHANGED); auto varName = message::eventName(message::RANGE_CHANGED);
if( !varList.checkObjectType<rangeU32>(varName) ) if( !varList.checkObjectType<rangeU32>(varName) )
{ {
fatalErrorInFunction<<"Wrong type for variable "<< varName<<endl; fatalErrorInFunction<<"Wrong type for variable "<< varName<<endl<<
"You requested "<< getTypeName<rangeU32>()<<" but the type is"<<
varList.getObjectTypeName(varName)<<endl;
return false; return false;
} }

View File

@ -124,7 +124,7 @@ bool pFlow::subscriber::unsubscribe
return true; return true;
} }
bool pFlow::subscriber::notify /*bool pFlow::subscriber::notify
( (
uint32 iter, uint32 iter,
real t, real t,
@ -151,7 +151,7 @@ bool pFlow::subscriber::notify
} }
} }
return true; return true;
} }*/
bool pFlow::subscriber::notify(const timeInfo &ti, const message msg, const anyList &varList) bool pFlow::subscriber::notify(const timeInfo &ti, const message msg, const anyList &varList)
{ {

View File

@ -69,12 +69,12 @@ public:
virtual bool unsubscribe(observer* obsevr)const; virtual bool unsubscribe(observer* obsevr)const;
/// TODO: remove this API from thie class /// TODO: remove this API from thie class
bool notify( /*bool notify(
uint32 iter, uint32 iter,
real t, real t,
real dt, real dt,
const message msg, const message msg,
const anyList& varList); const anyList& varList);*/
bool notify( bool notify(
const timeInfo& ti, const timeInfo& ti,

View File

@ -118,3 +118,10 @@ pFlow::fatalExitPhasicFlow(int errorCode)
pFlow::processors::abort(errorCode); pFlow::processors::abort(errorCode);
return errorCode; return errorCode;
} }
pFlow::iOstream&
pFlow::reportPing(const char* fileName, int fileLineNumber)
{
errorStream<<"Ping! ("<<fileLineNumber<<"):"<<fileName<<endl;
return errorStream;
}

View File

@ -66,6 +66,8 @@ warningMessage(const char* fnName, const char* fileName, int linNumber);
pFlow::iOstream& pFlow::iOstream&
reportAndExit(int errorCode = EXIT_FAILURE); reportAndExit(int errorCode = EXIT_FAILURE);
pFlow::iOstream& reportPing(const char* fileName, int fileLineNumber);
} }
/// Report a fatal error and exit the applicaiton /// Report a fatal error and exit the applicaiton
@ -99,4 +101,6 @@ reportAndExit(int errorCode = EXIT_FAILURE);
/// Fatal exit /// Fatal exit
#define fatalExit pFlow::reportAndExit() #define fatalExit pFlow::reportAndExit()
#define Ping pFlow::reportPing(__FILE__, __LINE__)
#endif #endif

View File

@ -65,9 +65,7 @@ bool pFlow::boundaryBase::appendNewIndices
newIndices); newIndices);
if(!notify( if(!notify(
internal_.time().currentIter(), internal_.time().TimeInfo(),
internal_.time().currentTime(),
internal_.time().dt(),
msg, msg,
varList)) varList))
{ {
@ -109,18 +107,13 @@ bool pFlow::boundaryBase::removeIndices
} }
anyList aList; anyList aList;
message msgBndry;
aList.emplaceBack( aList.emplaceBack(
message::eventName(message::BNDR_RESET), msgBndry.addAndName(message::BNDR_RESET),
std::move(keepIndices)); std::move(keepIndices));
message msgBndry = message::BNDR_RESET; if( !this->notify(time().TimeInfo(), msgBndry, aList) )
uint32 iter = time().currentIter();
real t = time().currentTime();
real dt = time().dt();
if( !this->notify(iter, t, dt, msgBndry, aList) )
{ {
fatalErrorInFunction<<"Error in notify operation in boundary "<< fatalErrorInFunction<<"Error in notify operation in boundary "<<
name() <<endl; name() <<endl;