b2api
B2000++ API Reference Manual, VERSION 4.6
 
Loading...
Searching...
No Matches
test_setup.H
1//------------------------------------------------------------------------
2// test_setup.H --
3//
4// Header file for providing setups for testing.
5//
6// written by Harald Klimach <harald.klimach@dlr.de>
7// Neda Ebrahimi Pour <neda.ebrahimipour@dlr.de>
8//
9// (c) 2024 Deutsches Zentrum für Luft- und Raumfahrt (DLR) e.V.
10// Linder Höhe, 51147 Köln
11//
12// All Rights Reserved. Proprietary source code. The contents of
13// this file may not be disclosed to third parties, copied or
14// duplicated in any form, in whole or in part, without the prior
15// written permission of SMR or DLR.
16//
17//------------------------------------------------------------------------
18
19#ifndef TEST_SETUP_H_
20#define TEST_SETUP_H_
21
22#include <string>
23
24#include "model/b2model.H"
25
26namespace b2utest {
27
37 const std::string get_db();
38
39public:
41 test_setup(std::string basename) : basename_(basename) {}
42
48
49protected:
54 virtual std::string fname() const { return basename_; }
55
61 virtual void create_mdl(std::string filename) const = 0;
62
63 std::string basename_;
64};
65
72class ScordelisLo : public test_setup {
73public:
78 ScordelisLo(int ne, std::string basename) : ne_(ne), test_setup(basename) {}
79 explicit ScordelisLo(int ne) : ScordelisLo(ne, "SL_roof") {}
80 explicit ScordelisLo() : ScordelisLo(3) {}
81
82private:
87 std::string fname() const override;
88
93 void create_mdl(std::string filename) const override;
94
95 int ne_;
96};
97
104class SimpleTension : public test_setup {
105public:
110 SimpleTension(int nx, int ny, std::string basename) : nx_(nx), ny_(ny), test_setup(basename) {}
111 explicit SimpleTension(int nx, int ny) : SimpleTension(nx, ny, "S_tension") {}
112 explicit SimpleTension() : SimpleTension(1, 1) {}
113
114private:
119 std::string fname() const override;
120
125 void create_mdl(std::string filename) const override;
126
127 int nx_;
128 int ny_;
129};
130} // namespace b2utest
131#endif // TEST_SETUP_H_
Definition b2model.H:69
Definition test_setup.H:72
ScordelisLo(int ne, std::string basename)
Definition test_setup.H:78
Definition test_setup.H:104
SimpleTension(int nx, int ny, std::string basename)
Definition test_setup.H:110
Definition test_setup.H:33
test_setup(std::string basename)
Constructor of setup with a basename.
Definition test_setup.H:41
virtual void create_mdl(std::string filename) const =0
virtual std::string fname() const
Definition test_setup.H:54
b2000::Model * create_model()
Definition test_setup.C:42