65 Parameters default_parameters = GetDefaultParameters();
66 Parameters search_parameters(default_parameters[
"search_parameters"].WriteJsonString());
73 Parameters default_parameters = GetDefaultParameters();
75 const std::string& r_container_type = ThisParameters[
"container_type"].
GetString();
76 Parameters search_parameters(ThisParameters[
"search_parameters"].WriteJsonString());
77 if (r_container_type ==
"KDTree" || r_container_type ==
"kd_tree") {
79 }
else if (r_container_type ==
"Octree" || r_container_type ==
"octree") {
81 }
else if (r_container_type ==
"BinsStatic" || r_container_type ==
"bins_static") {
83 }
else if (r_container_type ==
"BinsDynamic" || r_container_type ==
"bins_dynamic") {
86 KRATOS_ERROR <<
"Unknown container type: " << r_container_type << std::endl;
108 mpSpatialSearch->SearchElementsInRadiusExclusive(rStructureElements, rInputElements, rRadius, rResults, rResultsDistance);
121 mpSpatialSearch->SearchElementsInRadiusExclusive(rStructureElements, rInputElements, rRadius, rResults);
135 mpSpatialSearch->SearchNodesInRadiusExclusive(rStructureNodes, rInputNodes, rRadius, rResults, rResultsDistance);
148 mpSpatialSearch->SearchNodesInRadiusExclusive(rStructureNodes, rInputNodes, rRadius, rResults);
162 mpSpatialSearch->SearchConditionsInRadiusExclusive(rStructureConditions, rInputConditions, rRadius, rResults, rResultsDistance);
175 mpSpatialSearch->SearchConditionsInRadiusExclusive(rStructureConditions, rInputConditions, rRadius, rResults);
183 std::string
Info()
const override
185 std::stringstream buffer;
186 buffer <<
"SpecializedSpatialSearchFactory" ;
194 rOStream <<
"SpecializedSpatialSearchFactory";
208 SpatialSearch::Pointer mpSpatialSearch =
nullptr;
221 { "container_type" : "KDTree",
222 "search_parameters" : {
224 "allocation_size" : 1000
228 return default_parameters;
247 rOStream << std::endl;
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
void RecursivelyValidateAndAssignDefaults(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing match the form prescribed by th...
Definition: kratos_parameters.cpp:1389
std::string GetString() const
This method returns the string contained in the current Parameter.
Definition: kratos_parameters.cpp:684
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
This class is used to search for elements, conditions and nodes in a given model part.
Definition: spatial_search.h:50
std::vector< ResultConditionsContainerType > VectorResultConditionsContainerType
Definition: spatial_search.h:92
std::vector< double > RadiusArrayType
Input/output types.
Definition: spatial_search.h:95
std::vector< DistanceType > VectorDistanceType
Definition: spatial_search.h:97
std::vector< ResultNodesContainerType > VectorResultNodesContainerType
Definition: spatial_search.h:82
std::vector< ResultElementsContainerType > VectorResultElementsContainerType
Definition: spatial_search.h:87
Factory for the specialized spatial search.
Definition: specialized_spatial_search_factory.h:51
std::string Info() const override
Turn back information as a string.
Definition: specialized_spatial_search_factory.h:183
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: specialized_spatial_search_factory.h:192
KRATOS_CLASS_POINTER_DEFINITION(SpecializedSpatialSearchFactory)
void SearchElementsInRadiusExclusive(const ElementsContainerType &rStructureElements, const ElementsContainerType &rInputElements, const RadiusArrayType &rRadius, VectorResultElementsContainerType &rResults, VectorDistanceType &rResultsDistance) override
Search neighbours for every element in "rInputElements" excluding itself.
Definition: specialized_spatial_search_factory.h:100
void SearchConditionsInRadiusExclusive(const ConditionsContainerType &rStructureConditions, const ConditionsContainerType &rInputConditions, const RadiusArrayType &rRadius, VectorResultConditionsContainerType &rResults, VectorDistanceType &rResultsDistance) override
Search neighbours for every Condition in "rInputConditions" excluding itself.
Definition: specialized_spatial_search_factory.h:154
SpecializedSpatialSearchFactory()
Default constructor.
Definition: specialized_spatial_search_factory.h:63
void SearchNodesInRadiusExclusive(const NodesContainerType &rStructureNodes, const NodesContainerType &rInputNodes, const RadiusArrayType &rRadius, VectorResultNodesContainerType &rResults) override
Search neighbours for every node in "rInputNodes" excluding itself.
Definition: specialized_spatial_search_factory.h:141
void SearchElementsInRadiusExclusive(const ElementsContainerType &rStructureElements, const ElementsContainerType &rInputElements, const RadiusArrayType &rRadius, VectorResultElementsContainerType &rResults) override
Search neighbours for every element in "rInputElements" excluding itself.
Definition: specialized_spatial_search_factory.h:114
SpecializedSpatialSearchFactory(Parameters ThisParameters)
Constructor with parameters.
Definition: specialized_spatial_search_factory.h:71
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: specialized_spatial_search_factory.h:198
~SpecializedSpatialSearchFactory() override=default
Destructor.
void SearchConditionsInRadiusExclusive(const ConditionsContainerType &rStructureConditions, const ConditionsContainerType &rInputConditions, const RadiusArrayType &rRadius, VectorResultConditionsContainerType &rResults) override
Search neighbours for every Condition in "rInputConditions" excluding itself.
Definition: specialized_spatial_search_factory.h:168
void SearchNodesInRadiusExclusive(const NodesContainerType &rStructureNodes, const NodesContainerType &rInputNodes, const RadiusArrayType &rRadius, VectorResultNodesContainerType &rResults, VectorDistanceType &rResultsDistance) override
Search neighbours for every node in "rInputNodes" excluding itself.
Definition: specialized_spatial_search_factory.h:127
This class is used to search for elements, conditions and nodes in a given model part.
Definition: specialized_spatial_search.h:72
#define KRATOS_ERROR
Definition: exception.h:161
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432