Advanced Multi-Physics (AMP)
On-Line Documentation
NodeToNodeMap.h
Go to the documentation of this file.
1#ifndef included_AMP_NodeToNodeMap
2#define included_AMP_NodeToNodeMap
3
4
5#include <list>
6#include <vector>
7
8#include "AMP/operators/map/AsyncMapOperator.h"
9#include "AMP/operators/map/NodeToNodeMapParameters.h"
10
11#include "AMP/discretization/DOF_Manager.h"
12#include "AMP/mesh/Mesh.h"
13#include "AMP/utils/AMP_MPI.h"
14#include "AMP/vectors/Vector.h"
15
16
17namespace AMP::Operator {
18
19
25{
26public:
29
31 std::string type() const override { return "NodeToNodeMap"; }
32
37 static bool validMapType( const std::string &s );
38
40 static const int CommTagBase = 10000;
41
43 explicit NodeToNodeMap( std::shared_ptr<const AMP::Operator::OperatorParameters> params );
44
46 virtual ~NodeToNodeMap();
47
50
53
55
57
58 // Function to determine if a makeConsistentSet is required
60
61
62private:
63 class Point
64 {
65 public:
67 double pos[3];
68 int proc;
70 Point( const Point &rhs ) = default;
71 Point &operator=( const Point &rhs ) = default;
72 bool operator==( const Point &rhs ) const;
73 bool operator!=( const Point &rhs ) const;
74 bool operator<=( const Point &rhs ) const;
75 bool operator>=( const Point &rhs ) const;
76 bool operator<( const Point &rhs ) const;
77 bool operator>( const Point &rhs ) const;
78 };
79
80 // Some basic variables
83
84 // Store the pairs of points that are aligned for each mesh owned by the current processor
85 std::vector<std::pair<Point, Point>> d_localPairsMesh1;
86 std::vector<std::pair<Point, Point>> d_localPairsMesh2;
87
88 // Variables for communication
90 std::vector<int> d_count;
91 std::vector<int> d_displ;
92 std::vector<double> d_sendBuffer;
93 std::vector<double> d_recvBuffer;
94
95 // Other data
97
98 // Function to compute the pairs of points for each mesh
99 // Note: This function requires global communication across the map comm
100 void createPairs( bool requireAllPaired = true );
101
102 // Function to create the list of owned points from the iterator over the surface nodes
103 std::vector<Point> createOwnedPoints( const AMP::Mesh::MeshIterator & );
104
105 // Function to create the communication lists
107
108protected:
109 int dim;
111 // Lists of MeshElementIDs to send/recv for each processor (note: orders must match for each
112 // processor)
113 // We want to construct the lists so that we can do a global or pair-wise communication
114 std::vector<AMP::Mesh::MeshElementID> d_sendList;
115 std::vector<AMP::Mesh::MeshElementID> d_recvList;
116};
117} // namespace AMP::Operator
118
119
120#endif
std::shared_ptr< Vector > shared_ptr
Shorthand for shared pointer to Vector.
Definition Vector.h:60
std::shared_ptr< const Vector > const_shared_ptr
Definition Vector.h:65
A class used to iterate over elements in a Mesh.
A base class for asynchronous map operations between meshes. A map operation involves two meshes and ...
AMP::Mesh::MeshElementID id
bool operator<=(const Point &rhs) const
Point & operator=(const Point &rhs)=default
bool operator>=(const Point &rhs) const
bool operator!=(const Point &rhs) const
bool operator<(const Point &rhs) const
bool operator>(const Point &rhs) const
Point(const Point &rhs)=default
bool operator==(const Point &rhs) const
A class for mapping a vector from one surface to another where the nodes are aligned....
std::string type() const override
Return the name of the operator.
std::vector< AMP::Mesh::MeshElementID > d_recvList
void applyStart(AMP::LinearAlgebra::Vector::const_shared_ptr u, AMP::LinearAlgebra::Vector::shared_ptr f) override
Start a communicative apply operation.
NodeToNodeMap(std::shared_ptr< const AMP::Operator::OperatorParameters > params)
Constructor.
static const int CommTagBase
The base tag used in communication.
NodeToNodeMapParameters Parameters
brief Typedef to identify the parameters class of this operator
bool requiresMakeConsistentSet() override
void createPairs(bool requireAllPaired=true)
virtual ~NodeToNodeMap()
Destructor.
AMP::Mesh::MeshIterator d_iterator1
std::vector< AMP::Mesh::MeshElementID > d_sendList
void setVector(AMP::LinearAlgebra::Vector::shared_ptr p) override
Set a frozen vector for results of the apply operation.
std::vector< int > d_count
std::vector< int > d_displ
static bool validMapType(const std::string &s)
Returns true if MapType = "NodeToNode".
void applyFinish(AMP::LinearAlgebra::Vector::const_shared_ptr u, AMP::LinearAlgebra::Vector::shared_ptr f) override
Finish a communicative apply operation.
AMP::Mesh::MeshIterator d_iterator2
std::vector< double > d_recvBuffer
std::vector< std::pair< Point, Point > > d_localPairsMesh2
std::vector< Point > createOwnedPoints(const AMP::Mesh::MeshIterator &)
std::vector< double > d_sendBuffer
std::vector< std::pair< Point, Point > > d_localPairsMesh1
virtual AMP::LinearAlgebra::Vector::shared_ptr getVector()
std::shared_ptr< AMP::Operator::Operator > shared_ptr
Definition Operator.h:29
A structure used to identify the mesh element.
Definition MeshID.h:156



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:41.
Comments on this page