1#ifndef included_AMP_VectorSelector_h
2#define included_AMP_VectorSelector_h
4#include "AMP/mesh/Mesh.h"
5#include "AMP/mesh/MeshIterator.h"
6#include "AMP/vectors/Vector.h"
45 virtual std::shared_ptr<Vector>
subset( std::shared_ptr<Vector> vec )
const = 0;
51 std::shared_ptr<const Vector>
subset( std::shared_ptr<const Vector> vec )
const;
59 static std::shared_ptr<VectorSelector>
60 create(
const std::vector<std::shared_ptr<VectorSelector>> &selectors );
92 virtual std::shared_ptr<Vector>
subset( std::shared_ptr<Vector> vec )
const override;
111 virtual std::shared_ptr<Vector>
subset( std::shared_ptr<Vector> vec )
const override;
141 virtual std::shared_ptr<Vector>
subset( std::shared_ptr<Vector> vec )
const override;
164 virtual std::shared_ptr<Vector>
subset( std::shared_ptr<Vector> vec )
const override;
185 explicit VS_Mesh( std::shared_ptr<const AMP::Mesh::Mesh> mesh,
bool useMeshComm =
true );
189 virtual std::shared_ptr<Vector>
subset( std::shared_ptr<Vector> vec )
const override;
195 std::shared_ptr<const AMP::Mesh::Mesh>
d_mesh;
213 virtual std::shared_ptr<Vector>
subset( std::shared_ptr<Vector> vec )
const override;
229 std::shared_ptr<Vector>
subset( std::shared_ptr<Vector> vec )
const override {
return vec; }
239 MultiSelector(
const std::vector<std::shared_ptr<VectorSelector>> &selectors );
241 std::shared_ptr<Vector>
subset( std::shared_ptr<Vector> vec )
const override;
Provides C++ wrapper around MPI routines.
MultiSelector(const std::vector< std::shared_ptr< VectorSelector > > &selectors)
std::vector< std::shared_ptr< VectorSelector > > d_selectors
std::shared_ptr< Vector > subset(std::shared_ptr< Vector > vec) const override
Subset the given vector.
bool isSelected(const Vector &) const override
Returns true if Vector grossly matches a selection condition.
bool isSelected(const Vector &) const override
Returns true if Vector grossly matches a selection condition.
std::shared_ptr< Vector > subset(std::shared_ptr< Vector > vec) const override
Subset the given vector.
Select a subvector based on the name of the variable.
virtual bool isSelected(const Vector &v) const override
Returns true if Vector grossly matches a selection condition.
virtual std::shared_ptr< Vector > subset(std::shared_ptr< Vector > vec) const override
Subset the given vector.
const std::string & getName() const
VS_ByVariableName(std::string name)
Constructor.
Create a subset based on a AMP_MPI comm.
virtual AMP_MPI communicator(const Vector &vec) const override
Returns the communicator for the subset.
virtual bool isSelected(const Vector &v) const override
Returns true if Vector grossly matches a selection condition.
virtual std::shared_ptr< Vector > subset(std::shared_ptr< Vector > vec) const override
Subset the given vector.
VS_Comm(const AMP_MPI &comm)
Constructor.
Create a subset based on the components of a vector.
VS_Components(std::vector< size_t > index)
Constructor.
virtual std::shared_ptr< Vector > subset(std::shared_ptr< Vector > vec) const override
Subset the given vector.
const auto & getIndices() const
Get the indices.
std::vector< size_t > d_index
VS_Components(size_t index)
Constructor.
virtual bool isSelected(const Vector &v) const override
Returns true if Vector grossly matches a selection condition.
Create a subset based on a mesh iterator.
VS_MeshIterator(const AMP::Mesh::MeshIterator &iterator, const AMP::AMP_MPI &comm)
Constructor.
virtual bool isSelected(const Vector &v) const override
Returns true if Vector grossly matches a selection condition.
const Mesh::MeshIterator d_iterator
virtual std::shared_ptr< Vector > subset(std::shared_ptr< Vector > vec) const override
Subset the given vector.
Create a subset based on a mesh.
virtual AMP_MPI communicator(const Vector &vec) const override
Returns the communicator for the subset.
virtual bool isSelected(const Vector &v) const override
Returns true if Vector grossly matches a selection condition.
virtual std::shared_ptr< Vector > subset(std::shared_ptr< Vector > vec) const override
Subset the given vector.
std::shared_ptr< const AMP::Mesh::Mesh > d_mesh
VS_Mesh(std::shared_ptr< const AMP::Mesh::Mesh > mesh, bool useMeshComm=true)
Constructor.
Create a subset based on a stride in the vector.
virtual std::shared_ptr< Vector > subset(std::shared_ptr< Vector > vec) const override
Subset the given vector.
virtual bool isSelected(const Vector &v) const override
Returns true if Vector grossly matches a selection condition.
VS_Stride(size_t offset, size_t length)
Constructor.
A class used by Vector::select and Vector::selectInto to create vectors with particular data.
virtual std::shared_ptr< Vector > subset(std::shared_ptr< Vector > vec) const =0
Subset the given vector.
virtual AMP_MPI communicator(const Vector &vec) const
Returns the communicator for the subset.
static std::shared_ptr< VectorSelector > create(const std::vector< std::shared_ptr< VectorSelector > > &selectors)
Create a VectorSelector.
virtual ~VectorSelector()
Virtual destructor.
virtual bool isSelected(const Vector &vec) const =0
Returns true if Vector grossly matches a selection condition.
std::shared_ptr< const Vector > subset(std::shared_ptr< const Vector > vec) const
Subset the given vector.
Abstraction of a discrete Vector in a linear simulation.
A class used to iterate over elements in a Mesh.