Advanced Multi-Physics (AMP)
On-Line Documentation
Map3to1to3.h
Go to the documentation of this file.
1#ifndef included_AMP_Map3to1to3
2#define included_AMP_Map3to1to3
3
4#include <map>
5#include <vector>
6
7#include "AMP/mesh/MeshIterator.h"
8#include "AMP/operators/map/AsyncMapOperator.h"
9#include "AMP/operators/map/AsyncMapOperatorParameters.h"
10
11
12namespace AMP::Operator {
13
31{
32public:
36 explicit Map3to1to3( std::shared_ptr<const OperatorParameters> params );
37
39 virtual ~Map3to1to3();
40
42 std::string type() const override { return "Map3to1to3"; }
43
49
55
61
62
63protected:
69 void addTo1DMap( std::multimap<double, double> &map, double z, double val );
70
76 void addTo1DMap( std::multimap<double, double> &map,
77 const std::vector<double> &z,
78 const std::vector<double> &val );
79
87 virtual std::multimap<double, double>
89 const std::shared_ptr<AMP::Mesh::Mesh> mesh,
90 const AMP::Mesh::MeshIterator &it );
91
101 const std::shared_ptr<AMP::Mesh::Mesh> mesh,
102 const AMP::Mesh::MeshIterator &it,
103 const std::map<double, double> &map );
104
110
111private:
114
116 std::vector<bool> d_own_mesh1;
117 std::vector<bool> d_own_mesh2;
118
121
123 struct comm_data {
124 int N;
125 double z;
126 double sum;
128 {
129 N = 0;
130 z = 0.0;
131 sum = 0.0;
132 }
133 };
134
136 std::vector<comm_data> d_SendBuf1;
137 std::vector<comm_data> d_SendBuf2;
138
139 // Function to unpack the recv buffer
140 static void unpackBuffer( const std::vector<comm_data> &,
141 std::map<double, std::pair<int, double>> & );
142};
143
144
145} // namespace AMP::Operator
146
147#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 ...
For problems with a great deal of symmetry, it is possible to move data from one mesh to another by g...
Definition Map3to1to3.h:31
AMP::Mesh::MeshIterator d_srcIterator1
Iterators over the nodes on the boundary.
Definition Map3to1to3.h:106
virtual ~Map3to1to3()
Destructor.
AMP::LinearAlgebra::Vector::shared_ptr d_ResultVector
The place to put the mapped values.
Definition Map3to1to3.h:113
int d_commTag
The tag used for communication.
Definition Map3to1to3.h:120
void setVector(AMP::LinearAlgebra::Vector::shared_ptr result) override
Set a frozen vector for results of the apply operation.
Map3to1to3(std::shared_ptr< const OperatorParameters > params)
Standard constructor.
void addTo1DMap(std::multimap< double, double > &map, const std::vector< double > &z, const std::vector< double > &val)
Add an ordered pair to the set of interpolant values.
std::vector< bool > d_own_mesh2
Definition Map3to1to3.h:117
void applyFinish(AMP::LinearAlgebra::Vector::const_shared_ptr u, AMP::LinearAlgebra::Vector::shared_ptr f) override
Finish a communicative apply operation.
void addTo1DMap(std::multimap< double, double > &map, double z, double val)
Add an ordered pair to the set of interpolant values.
std::vector< comm_data > d_SendBuf1
The buffer used to perform the asynchronous communication.
Definition Map3to1to3.h:136
virtual void buildReturn(AMP::LinearAlgebra::Vector::shared_ptr vec, const std::shared_ptr< AMP::Mesh::Mesh > mesh, const AMP::Mesh::MeshIterator &it, const std::map< double, double > &map)
A virtual method to construct a vector from a map.
AMP::Mesh::MeshIterator d_dstIterator1
Definition Map3to1to3.h:108
virtual std::multimap< double, double > buildMap(AMP::LinearAlgebra::Vector::const_shared_ptr vec, const std::shared_ptr< AMP::Mesh::Mesh > mesh, const AMP::Mesh::MeshIterator &it)
A virtual method to construct the map from a vector.
AMP::Mesh::MeshIterator d_dstIterator2
Definition Map3to1to3.h:109
static void unpackBuffer(const std::vector< comm_data > &, std::map< double, std::pair< int, double > > &)
void applyStart(AMP::LinearAlgebra::Vector::const_shared_ptr u, AMP::LinearAlgebra::Vector::shared_ptr f) override
Start a communicative apply operation.
AMP::Mesh::MeshIterator d_srcIterator2
Definition Map3to1to3.h:107
std::string type() const override
Return the name of the operator.
Definition Map3to1to3.h:42
std::vector< comm_data > d_SendBuf2
Definition Map3to1to3.h:137
std::vector< bool > d_own_mesh1
A list of processors that own each mesh.
Definition Map3to1to3.h:116
std::shared_ptr< AMP::Operator::Operator > shared_ptr
Definition Operator.h:29
structure used for communication
Definition Map3to1to3.h:123



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