MaMiCo 1.2
Loading...
Searching...
No Matches
Strouhal.h
1// This file is part of the Mamico project. For conditions of distribution
2// and use, please see the copyright notice in Mamico's main folder, or at
3// www5.in.tum.de/mamico
4
5#pragma once
6#include "coupling/filtering/interfaces/FilterInterfaceReadOnly.h"
7#include <algorithm>
8#include <vector>
9
10#define DEBUG_STROUHAL
11
12namespace coupling {
13namespace filtering {
14template <unsigned int dim> class Strouhal;
15}
16} // namespace coupling
17
26template <unsigned int dim> class coupling::filtering::Strouhal : public coupling::filtering::FilterInterfaceReadOnly<dim> {
27public:
28 Strouhal(const std::vector<coupling::datastructures::CouplingCell<dim>*>& inputCellVector,
29 const std::vector<coupling::datastructures::CouplingCell<dim>*>& outputCellVector,
30 const std::vector<tarch::la::Vector<dim, unsigned int>> cellIndices, std::array<bool, 7> filteredValues, double u, double d)
31 : coupling::filtering::FilterInterfaceReadOnly<dim>(inputCellVector, outputCellVector, cellIndices, filteredValues, "STROUHALCPP"), _U(u), _D(d) {
32 if (dim < 2) {
33 std::cout << "ERROR: Strouhal filter only works for dim >= 2." << std::endl;
34 exit(EXIT_FAILURE);
35 }
36#ifdef DEBUG_STROUHAL
37 std::cout << " STROUHAL: Instance created." << std::endl;
38#endif
39 }
40
41 ~Strouhal() {
42 std::cout << "STROUHAL NUMBER IN MD DOMAIN: " << calculateStrouhalNumber() << std::endl;
43#ifdef DEBUG_WRITE_TO_FILE
44 std::cout << " STROUHAL: Instance deconstructed." << std::endl;
45#endif
46 }
47
48 void operator()();
49
50private:
51 double calculateStrouhalNumber();
52
53 std::vector<double> _v_y;
54 double _U;
55 double _D;
56};
57
58// include implementation of header
59#include "Strouhal.cpph"
60
61/*
62 * TODO:
63 * allow offset (e.g. start measuring after 500 coupling cycles)
64 */
defines the cell type with cell-averaged quantities only (no linked cells).
Definition CouplingCell.h:29
Definition FilterInterfaceReadOnly.h:22
Definition Strouhal.h:26
Definition Vector.h:24
Definition FilterPipeline.h:21
everything necessary for coupling operations, is defined in here
Definition AdditiveMomentumInsertion.h:15