45 MapperInterfaceInfo::Pointer
Create()
const override;
49 const IndexType SourceRank)
const override;
53 void ProcessSearchResult(
const InterfaceObject& rInterfaceObject)
override;
64 std::size_t mNumSearchResults = 0;
68 void save(
Serializer& rSerializer)
const override;
79 void CalculateAll(
MatrixType& rLocalMappingMatrix,
80 EquationIdVectorType& rOriginIds,
81 EquationIdVectorType& rDestinationIds,
87 return mpNode->Coordinates();
92 return Kratos::make_unique<BarycentricLocalSystem>(pNode);
95 void PairingInfo(std::ostream& rOStream,
const int EchoLevel)
const override;
97 void SetPairingStatusForPrinting()
override;
99 bool IsDoneSearching()
const override;
108 template<
class TSparseSpace,
class TDenseSpace,
class TMapperBackend>
133 :
BaseType(rModelPartOrigin, rModelPartDestination) {}
139 rModelPartDestination,
144 auto check_has_nodes = [](
const ModelPart& rModelPart){
145 if (rModelPart.GetCommunicator().GetDataCommunicator().IsDefinedOnThisRank()) {
146 KRATOS_ERROR_IF(rModelPart.GetCommunicator().GlobalNumberOfNodes() == 0) <<
"No nodes exist in ModelPart \"" << rModelPart.FullName() <<
"\"" << std::endl;
149 check_has_nodes(rModelPartOrigin);
150 check_has_nodes(rModelPartDestination);
152 this->ValidateInput();
154 const std::string interpolation_type = JsonParameters[
"interpolation_type"].
GetString();
155 if (interpolation_type ==
"line") {
157 }
else if (interpolation_type ==
"triangle") {
159 }
else if (interpolation_type ==
"tetrahedra") {
162 KRATOS_ERROR <<
"BarycentricMapper: No \"interpolation_type\" was specified, please select \"line\", \"triangle\" or \"tetrahedra\"" << std::endl;
183 return Kratos::make_unique<BarycentricMapper<TSparseSpace, TDenseSpace, TMapperBackend>>(
185 rModelPartDestination,
196 std::string
Info()
const override
198 return "BarycentricMapper";
204 rOStream <<
"BarycentricMapper";
210 BaseType::PrintData(rOStream);
224 void CreateMapperLocalSystems(
230 rModelPartCommunicator,
236 return Kratos::make_unique<BarycentricInterfaceInfo>(mInterpolationType);
239 Parameters GetMapperDefaultSettings()
const override
241 return Parameters( R
"({
242 "search_settings" : {},
243 "interpolation_type" : "unspecified",
244 "local_coord_tolerance" : 0.25,
245 "use_initial_configuration" : false,
247 "print_pairing_status_to_file" : false,
248 "pairing_status_file_path" : ""
Definition: barycentric_mapper.h:36
std::size_t GetNumSearchResults() const
Definition: barycentric_mapper.h:59
const ClosestPointsContainer & GetClosestPoints() const
Definition: barycentric_mapper.h:57
BarycentricInterpolationType GetInterpolationType() const
Definition: barycentric_mapper.h:55
Definition: barycentric_mapper.h:74
BarycentricLocalSystem(NodePointerType pNode)
Definition: barycentric_mapper.h:77
MapperLocalSystemUniquePointer Create(NodePointerType pNode) const override
Definition: barycentric_mapper.h:90
CoordinatesArrayType & Coordinates() const override
Definition: barycentric_mapper.h:84
Barycentric Mapper.
Definition: barycentric_mapper.h:111
KRATOS_CLASS_POINTER_DEFINITION(BarycentricMapper)
std::string Info() const override
Turn back information as a string.
Definition: barycentric_mapper.h:196
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: barycentric_mapper.h:202
InterpolativeMapperBase< TSparseSpace, TDenseSpace, TMapperBackend > BaseType
Definition: barycentric_mapper.h:122
BaseType::MapperInterfaceInfoUniquePointerType MapperInterfaceInfoUniquePointerType
Definition: barycentric_mapper.h:124
BaseType::MapperUniquePointerType MapperUniquePointerType
Definition: barycentric_mapper.h:123
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: barycentric_mapper.h:208
BarycentricMapper(ModelPart &rModelPartOrigin, ModelPart &rModelPartDestination)
Definition: barycentric_mapper.h:131
~BarycentricMapper() override=default
Destructor.
MapperUniquePointerType Clone(ModelPart &rModelPartOrigin, ModelPart &rModelPartDestination, Parameters JsonParameters) const override
Cloning the Mapper returns a clone of the current Mapper pure virtual, has to be implemented in every...
Definition: barycentric_mapper.h:177
BarycentricMapper(ModelPart &rModelPartOrigin, ModelPart &rModelPartDestination, Parameters JsonParameters)
Definition: barycentric_mapper.h:135
Definition: closest_points.h:74
The Commmunicator class manages communication for distributed ModelPart instances.
Definition: communicator.h:67
Object used by the bin-search.
Definition: interface_object.h:40
ConstructionType
Definition: interface_object.h:63
Definition: interpolative_mapper_base.h:81
BaseType::MapperUniquePointerType MapperUniquePointerType
Definition: interpolative_mapper_base.h:103
InterfaceCommunicator::MapperInterfaceInfoUniquePointerType MapperInterfaceInfoUniquePointerType
Definition: interpolative_mapper_base.h:93
Kratos::unique_ptr< Mapper > MapperUniquePointerType
Definition: mapper.h:53
Object for storing data that is needed to construct the local-mapping-system.
Definition: mapper_interface_info.h:42
std::size_t IndexType
Definition: mapper_interface_info.h:50
InterfaceObject::CoordinatesArrayType CoordinatesArrayType
Definition: mapper_interface_info.h:52
This is the "Condition" of the mappers.
Definition: mapper_local_system.h:39
PairingStatus
Definition: mapper_local_system.h:63
MapperInterfaceInfo::CoordinatesArrayType CoordinatesArrayType
Definition: mapper_local_system.h:50
Kratos::unique_ptr< MapperLocalSystem > MapperLocalSystemUniquePointer
Definition: mapper_local_system.h:48
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
std::string GetString() const
This method returns the string contained in the current Parameter.
Definition: kratos_parameters.cpp:684
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
#define KRATOS_DEBUG_ERROR_IF_NOT(conditional)
Definition: exception.h:172
static int EchoLevel
Definition: co_sim_EMPIRE_API.h:42
void CreateMapperLocalSystemsFromNodes(const MapperLocalSystem &rMapperLocalSystemPrototype, const Communicator &rModelPartCommunicator, std::vector< Kratos::unique_ptr< MapperLocalSystem >> &rLocalSystems)
Definition: mapper_utilities.cpp:236
Kratos::unique_ptr< MapperInterfaceInfo > MapperInterfaceInfoUniquePointerType
Definition: mapper_utilities.h:40
NodeType::Pointer NodePointerType
Definition: mapping_intersection_utilities.h:36
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
PairingIndex
Definition: projection_utilities.h:32
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::unique_ptr< T > unique_ptr
Definition: smart_pointers.h:33
BarycentricInterpolationType
Definition: barycentric_mapper.h:29
def load(f)
Definition: ode_solve.py:307