Alsvinn  0.5.3
The fast FVM simulator with UQ support
CartesianCellExchanger.hpp
Go to the documentation of this file.
1 /* Copyright (c) 2018 ETH Zurich, Kjetil Olsen Lye
2  * This program is free software: you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation, either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program. If not, see <http://www.gnu.org/licenses/>.
14  */
15 
16 #pragma once
18 #include "alsfvm/types.hpp"
21 #include "alsfvm/mpi/Request.hpp"
23 
24 namespace alsfvm {
25 namespace mpi {
26 
29 public:
30 
46  const ivec6& neighbours);
47 
50  const alsfvm::volume::Volume& inputVolume) override;
51 
52  bool hasSide(int side) const;
53 
54  real max(real value) override;
55 
56  ivec6 getNeighbours() const override;
57 
58 private:
59  ConfigurationPtr configuration;
60 
61  const ivec6 neighbours;
62 
63  std::vector<MpiIndexTypePtr> datatypesReceive;
64  std::vector<MpiIndexTypePtr> datatypesSend;
65 
66  void createDataTypes(const volume::Volume& volume);
67  void createDataTypeSend(int side, const volume::Volume& volume);
68  void createDataTypeReceive(int side, const volume::Volume& volume);
69 };
70 } // namespace mpi
71 } // namespace alsfvm
Does the cell exchange for a cartesian grid.
Definition: CartesianCellExchanger.hpp:28
real max(real value) override
Does the maximum over all processors.
Definition: CartesianCellExchanger.cpp:38
virtual RequestContainer exchangeCells(alsfvm::volume::Volume &outputVolume, const alsfvm::volume::Volume &inputVolume) override
Does the exchange of data.
Definition: CartesianCellExchanger.cpp:51
bool hasSide(int side) const
Definition: CartesianCellExchanger.cpp:33
The Volume class represents a volume (a collection of cells with values for each cell (eg...
Definition: Volume.hpp:30
Abstract base class for exchanging cells.
Definition: CellExchanger.hpp:26
double real
Definition: types.hpp:65
Holds a collection of requests.
Definition: RequestContainer.hpp:23
alsfvm::shared_ptr< Configuration > ConfigurationPtr
Definition: Configuration.hpp:53
Various utility functions to implement the tecno flux.
Definition: types.hpp:30
ivec6 getNeighbours() const override
Definition: CartesianCellExchanger.cpp:47
CartesianCellExchanger(ConfigurationPtr &configuration, const ivec6 &neighbours)
Definition: CartesianCellExchanger.cpp:27