38 template <
typename TObjectType>
59 mIsObjectFound(false),
60 mIsDistanceCalculated(false)
68 ) : mpObject(pObject, Rank),
70 mIsObjectFound(false),
71 mIsDistanceCalculated(false)
73 if (mpObject.
get() !=
nullptr)
74 mIsObjectFound =
true;
103 mIsObjectFound =
false;
104 mIsDistanceCalculated =
false;
122 void Set(TObjectType* pObject) {
124 mIsObjectFound =
true;
134 mDistance = TheDistance;
135 mIsDistanceCalculated =
true;
140 return mIsObjectFound;
150 return mIsDistanceCalculated;
164 return mIsObjectFound;
169 return mIsDistanceCalculated;
177 virtual std::string
Info()
const
179 std::stringstream buffer;
180 buffer <<
"SpatialSearchResult" ;
185 virtual void PrintInfo(std::ostream& rOStream)
const {rOStream <<
"SpatialSearchResult";}
199 bool mIsDistanceCalculated;
213 rSerializer.
save(
"Object", mpObject);
214 rSerializer.
save(
"Distance", mDistance);
215 rSerializer.
save(
"Is Object Found", mIsObjectFound);
216 rSerializer.
save(
"Is Distance Calculated", mIsDistanceCalculated);
221 rSerializer.
load(
"Object", mpObject);
222 rSerializer.
load(
"Distance", mDistance);
223 rSerializer.
load(
"Is Object Found", mIsObjectFound);
224 rSerializer.
load(
"Is Distance Calculated", mIsDistanceCalculated);
240 template <
typename TObjectType>
247 template <
typename TObjectType>
252 rOStream << std::endl;
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
This class is the result of the spatial searches.
Definition: spatial_search_result.h:40
bool IsObjectFound() const
Returns true if the object is set.
Definition: spatial_search_result.h:163
KRATOS_CLASS_POINTER_DEFINITION(SpatialSearchResult)
Pointer definition of SpatialSearchResult.
virtual std::string Info() const
Turn back information as a string.
Definition: spatial_search_result.h:177
double GetDistance() const
Getting the result distance.
Definition: spatial_search_result.h:128
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: spatial_search_result.h:185
virtual ~SpatialSearchResult()
Destructor.
Definition: spatial_search_result.h:84
SpatialSearchResult & operator=(SpatialSearchResult const &)=default
Assignment operator.
SpatialSearchResult(SpatialSearchResult const &)=default
Copy constructor.
void SetIsObjectFound(const bool IsObjectFound)
Getting if the object is found.
Definition: spatial_search_result.h:144
void SetDistance(const double TheDistance)
Setting the result distance.
Definition: spatial_search_result.h:133
bool IsDistanceCalculated() const
Returns true if the distance is set.
Definition: spatial_search_result.h:168
void Reset()
Reset the result.
Definition: spatial_search_result.h:99
void Set(TObjectType *pObject)
Set the object to be pointed.
Definition: spatial_search_result.h:122
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: spatial_search_result.h:188
void SetIsDistanceCalculated(const bool IsDistanceCalculated)
Setting if the distance is calculated.
Definition: spatial_search_result.h:154
SpatialSearchResult()
Default constructor.
Definition: spatial_search_result.h:56
TPointerType Get()
Returns the global pointer to the object.
Definition: spatial_search_result.h:112
SpatialSearchResult(TObjectType *pObject, const int Rank=0)
Constructor with the resulted object.
Definition: spatial_search_result.h:65
bool GetIsDistanceCalculated() const
Getting if the distance is calculated.
Definition: spatial_search_result.h:149
bool GetIsObjectFound() const
Getting if the object is found.
Definition: spatial_search_result.h:139
GlobalPointer< TObjectType > TPointerType
Global pointer definition of TObjectType.
Definition: spatial_search_result.h:49
SpatialSearchResult(SpatialSearchResult &&)=default
Move constructor.
TPointerType const Get() const
Returns a const global pointer to the object.
Definition: spatial_search_result.h:117
TDataType * get()
Get a non-const pointer to the data.
Definition: global_pointer.h:245
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
def load(f)
Definition: ode_solve.py:307