Advanced Multi-Physics (AMP)
On-Line Documentation
structuredMeshIterator.h
Go to the documentation of this file.
1#ifndef included_AMP_structuredMeshIterators
2#define included_AMP_structuredMeshIterators
3
4#include "AMP/mesh/MeshIterator.h"
5#include "AMP/mesh/structured/BoxMesh.h"
6#include "AMP/mesh/structured/structuredMeshElement.h"
7#include <memory>
8
9#include <array>
10
11
12namespace AMP::Mesh {
13
14
16{
17public:
20
23 const BoxMesh::MeshElementIndex &last,
24 const AMP::Mesh::BoxMesh *mesh,
25 size_t pos = 0 );
26
29 const AMP::Mesh::BoxMesh *mesh,
30 size_t pos = 0 );
31
32
34 structuredMeshIterator( std::shared_ptr<const std::vector<BoxMesh::MeshElementIndex>> elements,
35 const AMP::Mesh::BoxMesh *mesh,
36 size_t pos = 0 );
37
40
43
46
49
52
54 std::string className() const override { return "structuredMeshIterator"; }
55
57 void setPos( size_t ) override;
58
61
64
65 // Arithmetic operator+=
66 MeshIteratorBase &operator+=( int N ) override;
67
69 bool operator==( const MeshIteratorBase &rhs ) const override;
70
72 bool operator!=( const MeshIteratorBase &rhs ) const override;
73
75 MeshIterator begin() const override;
76
78 std::unique_ptr<MeshIteratorBase> clone() const override;
79
80 using MeshIteratorBase::operator==;
81 using MeshIteratorBase::operator!=;
82
83
84public: // Write/read restart data
85 void registerChildObjects( AMP::IO::RestartManager *manager ) const override;
86 void writeRestart( int64_t fid ) const override;
88
89
90public: // Advanced interfaces
91 // Get the elements in the iterator
92 std::shared_ptr<const std::vector<BoxMesh::MeshElementIndex>> getElements() const;
93
94 // Get the current index
96
97
98private:
99 // Data members
101 std::shared_ptr<const std::vector<BoxMesh::MeshElementIndex>> d_elements;
104};
105
106
107} // namespace AMP::Mesh
108
109#endif
Class to manage reading/writing restart data.
Structure to uniquely identify an element.
Definition BoxMesh.h:109
A class used to represent a logically rectangular box mesh.
Definition BoxMesh.h:71
A base class used to iterate over elements in a Mesh.
size_t pos() const
Return the current position (from the beginning) in the iterator.
A class used to iterate over elements in a Mesh.
A derived class used to define a mesh element.
bool operator==(const MeshIteratorBase &rhs) const override
Check if two iterators are equal.
std::shared_ptr< const std::vector< BoxMesh::MeshElementIndex > > d_elements
std::string className() const override
Return the class name.
structuredMeshIterator(const structuredMeshIterator &)
Copy constructor.
BoxMesh::MeshElementIndex getCurrentIndex() const
void registerChildObjects(AMP::IO::RestartManager *manager) const override
std::unique_ptr< MeshIteratorBase > clone() const override
Clone the iterator.
void writeRestart(int64_t fid) const override
MeshIteratorBase & operator++() override
Increment.
MeshIteratorBase & operator+=(int N) override
structuredMeshIterator(structuredMeshIterator &&)=delete
Move constructor.
structuredMeshIterator & operator=(structuredMeshIterator &&)=delete
Move operator.
MeshIteratorBase & operator--() override
Decrement.
MeshIterator begin() const override
Return an iterator to the begining.
structuredMeshIterator()
Empty structuredMeshIterator constructor.
BoxMesh::MeshElementIndexIterator d_it
virtual ~structuredMeshIterator()
Deconstructor.
structuredMeshIterator(const BoxMesh::MeshElementIndex &first, const BoxMesh::MeshElementIndex &last, const AMP::Mesh::BoxMesh *mesh, size_t pos=0)
Range base constructor.
structuredMeshIterator(int64_t fid, AMP::IO::RestartManager *manager)
bool operator!=(const MeshIteratorBase &rhs) const override
Check if two iterators are not equal.
structuredMeshIterator(const BoxMesh::MeshElementIndexIterator &it, const AMP::Mesh::BoxMesh *mesh, size_t pos=0)
Range base constructor.
structuredMeshIterator(std::shared_ptr< const std::vector< BoxMesh::MeshElementIndex > > elements, const AMP::Mesh::BoxMesh *mesh, size_t pos=0)
Element list constructor.
std::shared_ptr< const std::vector< BoxMesh::MeshElementIndex > > getElements() const
void setPos(size_t) override
Set the position in the iterator.
structuredMeshIterator & operator=(const structuredMeshIterator &)
Assignment operator.



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:40.
Comments on this page