Peano 4
Loading...
Searching...
No Matches
CellMarker.h
Go to the documentation of this file.
1// This file is part of the Peano project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#pragma once
4
7#include "tarch/la/Vector.h"
8
9#ifdef Parallel
10#include <functional>
11#include <mpi.h>
12#endif
13
14namespace peano4 {
15 namespace datamanagement {
16 struct CellMarker;
17 } // namespace datamanagement
18} // namespace peano4
19
20std::ostream& operator<<(std::ostream& out, const peano4::datamanagement::CellMarker& marker);
21
40private:
42
44
52
55
58
63
64public:
66
77 bool hasBeenRefined() const;
78
98 bool willBeRefined() const;
99
115
121
151
165 static bool isContained(
168 const tarch::la::Vector<Dimensions, double>& h, double tolerance
169 );
170
172
177
182
183 std::string toString() const;
184
189 bool isLocal() const;
190
199 bool isParentLocal() const;
200
225 bool hasBeenEnclaveCell() const;
226
230 bool willBeEnclaveCell() const;
231
237 bool hasBeenSkeletonCell() const;
238
242 bool willBeSkeletonCell() const;
243
245
246#if PeanoDebug > 0
250 void setRelativePositionWithinFatherCell(int axis, int value);
251#endif
252
253#ifdef Parallel
257 static void initDatatype();
258 static void shutdownDatatype();
259
268 static void send(const CellMarker& buffer, int destination, int tag, MPI_Comm communicator);
269 static void receive(CellMarker& buffer, int source, int tag, MPI_Comm communicator);
270
277 static void send(const CellMarker& buffer, int destination, int tag, std::function<void()> startCommunicationFunctor, std::function<void()> waitFunctor, MPI_Comm communicator);
278 static void receive(CellMarker& buffer, int source, int tag, std::function<void()> startCommunicationFunctor, std::function<void()> waitFunctor, MPI_Comm communicator);
279
280 static void sendAndPollDanglingMessages(const CellMarker& message, int destination, int tag, MPI_Comm communicator);
281 static void receiveAndPollDanglingMessages(CellMarker& message, int source, int tag, MPI_Comm communicator);
282
283 static MPI_Datatype Datatype;
284#endif
285};
std::ostream & operator<<(std::ostream &out, const peano4::datamanagement::CellMarker &marker)
Definition CellMarker.cpp:7
constexpr double NUMERICAL_ZERO_DIFFERENCE
Definition Scalar.h:17
tarch::la::Vector< Dimensions, double > x() const
Centre of a cell.
CellMarker(const peano4::grid::GridTraversalEvent &event)
bool isLocal() const
Usually if you have an event of a cell, then the cell is alo local.
tarch::la::Vector< Dimensions, double > getOffset() const
tarch::la::Vector< Dimensions, double > _h
Definition CellMarker.h:43
bool overlaps(const tarch::la::Vector< Dimensions, double > &offset, const tarch::la::Vector< Dimensions, double > &size) const
bool _invokingSpacetreeIsNotInvolvedInAnyDynamicLoadBalancing
Definition CellMarker.h:54
static void receive(CellMarker &buffer, int source, int tag, MPI_Comm communicator)
tarch::la::Vector< Dimensions, double > getInvokingParentCellsCentre() const
See getInvokingCellCentre().
bool hasBeenRefined() const
Has the cell been refined when we kicked off this mesh traversal.
tarch::la::Vector< Dimensions, int > getRelativePositionWithinFatherCell() const
tarch::la::Vector< Dimensions, int > _relativePositionOfCellWithinFatherCell
Entries from (0,1,2).
Definition CellMarker.h:62
bool hasBeenSkeletonCell() const
A skeleton cell is a not-enclave cell.
bool isParentLocal() const
A cell can be local and its parent still might not be local.
static void initDatatype()
To be called prior to any MPI usage of this class.
bool isContained(const tarch::la::Vector< Dimensions, double > &x, double tolerance=tarch::la::NUMERICAL_ZERO_DIFFERENCE) const
Is x contained within cell identified by marker object.
bool hasBeenEnclaveCell() const
Define enclave cell.
static void receiveAndPollDanglingMessages(CellMarker &message, int source, int tag, MPI_Comm communicator)
tarch::la::Vector< Dimensions, double > h() const
tarch::la::Vector< Dimensions, double > _centre
Definition CellMarker.h:41
static void sendAndPollDanglingMessages(const CellMarker &message, int destination, int tag, MPI_Comm communicator)
bool willBeRefined() const
Will the cell be refined in the subsequent iteration.
static void send(const CellMarker &buffer, int destination, int tag, MPI_Comm communicator)
In DaStGen (the first version), I had a non-static version of the send as well as the receive.
Simple vector class.
Definition Vector.h:134