MaMiCo
1.2
Toggle main menu visibility
Loading...
Searching...
No Matches
coupling
interface
PintableMacroSolver.h
1
// Copyright (C) 2023 Helmut Schmidt University
2
// This file is part of the Mamico project. For conditions of distribution
3
// and use, please see the copyright notice in Mamico's main folder
4
5
#pragma once
6
7
namespace
coupling
{
8
namespace
interface {
9
class
PintableMacroSolver
;
10
class
PintableMacroSolverState
;
11
}
// namespace interface
12
}
// namespace coupling
13
14
#include <memory>
15
30
class
coupling::interface::PintableMacroSolver
{
31
public
:
32
using
State =
PintableMacroSolverState
;
33
enum class
Mode { supervising,
coupling
};
34
35
virtual
~PintableMacroSolver
() {}
36
38
virtual
std::unique_ptr<State>
getState
() = 0;
39
41
virtual
void
setState
(
const
std::unique_ptr<State>&,
int
cycle = 0) = 0;
42
44
virtual
std::unique_ptr<State>
operator()
(
const
std::unique_ptr<State>&,
int
cycle = 0) = 0;
45
47
virtual
Mode
getMode
()
const
= 0;
48
50
virtual
std::unique_ptr<PintableMacroSolver>
getSupervisor
(
int
num_cycles,
double
visc_multiplier = 1)
const
= 0;
51
53
virtual
void
print
(std::ostream& os)
const
= 0;
54
57
virtual
double
get_avg_vel
(
const
std::unique_ptr<State>& state)
const
{
return
0; }
58
friend
std::ostream& operator<<(std::ostream& os,
const
coupling::interface::PintableMacroSolver
& s) {
59
s.
print
(os);
60
return
os;
61
}
62
};
63
67
class
coupling::interface::PintableMacroSolverState
{
68
public
:
69
using
State =
PintableMacroSolverState
;
70
71
virtual
std::unique_ptr<State> clone()
const
= 0;
72
73
virtual
~PintableMacroSolverState
() {}
74
76
virtual
int
getSizeBytes
()
const
= 0;
//
77
79
virtual
std::unique_ptr<State>
operator+
(
const
State&) = 0;
80
82
virtual
std::unique_ptr<State>
operator-
(
const
State&) = 0;
83
85
virtual
bool
operator==
(
const
State&)
const
= 0;
86
88
virtual
double
*
getData
() = 0;
89
91
virtual
const
double
*
getData
()
const
= 0;
92
94
virtual
void
print
(std::ostream& os)
const
= 0;
95
96
friend
std::ostream& operator<<(std::ostream& os,
const
coupling::interface::PintableMacroSolverState
& s) {
97
s.
print
(os);
98
return
os;
99
}
100
};
coupling::interface::PintableMacroSolverState
Definition
PintableMacroSolver.h:67
coupling::interface::PintableMacroSolverState::getData
virtual double * getData()=0
coupling::interface::PintableMacroSolverState::operator-
virtual std::unique_ptr< State > operator-(const State &)=0
coupling::interface::PintableMacroSolverState::getSizeBytes
virtual int getSizeBytes() const =0
coupling::interface::PintableMacroSolverState::operator==
virtual bool operator==(const State &) const =0
coupling::interface::PintableMacroSolverState::print
virtual void print(std::ostream &os) const =0
coupling::interface::PintableMacroSolverState::getData
virtual const double * getData() const =0
coupling::interface::PintableMacroSolverState::operator+
virtual std::unique_ptr< State > operator+(const State &)=0
coupling::interface::PintableMacroSolver
Definition
PintableMacroSolver.h:30
coupling::interface::PintableMacroSolver::getMode
virtual Mode getMode() const =0
coupling::interface::PintableMacroSolver::getSupervisor
virtual std::unique_ptr< PintableMacroSolver > getSupervisor(int num_cycles, double visc_multiplier=1) const =0
coupling::interface::PintableMacroSolver::getState
virtual std::unique_ptr< State > getState()=0
coupling::interface::PintableMacroSolver::operator()
virtual std::unique_ptr< State > operator()(const std::unique_ptr< State > &, int cycle=0)=0
coupling::interface::PintableMacroSolver::setState
virtual void setState(const std::unique_ptr< State > &, int cycle=0)=0
coupling::interface::PintableMacroSolver::get_avg_vel
virtual double get_avg_vel(const std::unique_ptr< State > &state) const
Definition
PintableMacroSolver.h:57
coupling::interface::PintableMacroSolver::print
virtual void print(std::ostream &os) const =0
coupling
everything necessary for coupling operations, is defined in here
Definition
AdditiveMomentumInsertion.h:15
Generated by
1.17.0