Peano
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
154
172 static bool isContained(
176 double tolerance
177 );
178
180
185
190
191 std::string toString() const;
192
197 bool isLocal() const;
198
207 bool isParentLocal() const;
208
233 bool hasBeenEnclaveCell() const;
234
238 bool willBeEnclaveCell() const;
239
246
250 bool willBeSkeletonCell() const;
251
253
254#if PeanoDebug > 0
258 void setRelativePositionWithinFatherCell(int axis, int value);
259#endif
260
261#ifdef Parallel
265 static void initDatatype();
266 static void shutdownDatatype();
267
276 static void send(const CellMarker& buffer, int destination, int tag, MPI_Comm communicator);
277 static void receive(CellMarker& buffer, int source, int tag, MPI_Comm communicator);
278
285 static void send(const CellMarker& buffer, int destination, int tag, std::function<void()> startCommunicationFunctor, std::function<void()> waitFunctor, MPI_Comm communicator);
286 static void receive(CellMarker& buffer, int source, int tag, std::function<void()> startCommunicationFunctor, std::function<void()> waitFunctor, MPI_Comm communicator);
287
288 static void sendAndPollDanglingMessages(const CellMarker& message, int destination, int tag, MPI_Comm communicator);
289 static void receiveAndPollDanglingMessages(CellMarker& message, int source, int tag, MPI_Comm communicator);
290
291 static MPI_Datatype Datatype;
292#endif
293};
std::ostream & operator<<(std::ostream &out, const peano4::datamanagement::CellMarker &marker)
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
static bool isContained(const tarch::la::Vector< Dimensions, double > &x, const tarch::la::Vector< Dimensions, double > &cellCentre, const tarch::la::Vector< Dimensions, double > &h, double tolerance)
Is point contained in cell.
bool _invokingSpacetreeIsNotInvolvedInAnyDynamicLoadBalancing
Definition CellMarker.h:54
static void sendAndPollDanglingMessages(const CellMarker &message, int destination, 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.
static void receive(CellMarker &buffer, int source, int tag, std::function< void()> startCommunicationFunctor, std::function< void()> waitFunctor, MPI_Comm communicator)
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.
static void receiveAndPollDanglingMessages(CellMarker &message, int source, int tag, MPI_Comm communicator)
tarch::la::Vector< Dimensions, int > getRelativePositionWithinFatherCell() const
tarch::la::Vector< Dimensions, int > _relativePositionOfCellWithinFatherCell
Entries from (0,1,2).
Definition CellMarker.h:62
static void send(const CellMarker &buffer, int destination, int tag, std::function< void()> startCommunicationFunctor, std::function< void()> waitFunctor, MPI_Comm communicator)
Alternative to the other send() where I trigger a non-blocking send an then invoke the functor until ...
bool hasBeenSkeletonCell() const
A skeleton cell is a not-enclave cell.
static void initDatatype()
To be called prior to any MPI usage of this class.
bool isParentLocal() const
A cell can be local and its parent still might not be local.
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.
tarch::la::Vector< Dimensions, double > h() const
static void receive(CellMarker &buffer, int source, int tag, MPI_Comm communicator)
tarch::la::Vector< Dimensions, double > _centre
Definition CellMarker.h:41
bool willBeRefined() const
Will the cell be refined in the subsequent iteration.
Simple vector class.
Definition Vector.h:159