suanPan
🧮 An Open Source, Parallel and Heterogeneous Finite Element Analysis Framework
Loading...
Searching...
No Matches
Bead.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2026 Theodore Chang
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ******************************************************************************/
26#ifndef BEAD_H
27#define BEAD_H
28
29#include <Domain/Storage.hpp>
30
31class DomainBase;
32
33class Bead {
34 unsigned current_domain_tag = 1;
35
36 DomainBaseStorage domain_pool;
37
38 std::unordered_map<std::string, std::string> variable_map;
39
40public:
41 Bead();
42
43 bool insert(const shared_ptr<DomainBase>&);
44 void erase_domain(unsigned);
45 void enable_domain(unsigned);
46 void disable_domain(unsigned);
47
48 void set_current_domain_tag(unsigned);
49 unsigned get_current_domain_tag() const;
50
51 const shared_ptr<DomainBase>& get_domain(unsigned) const;
52 const shared_ptr<DomainBase>& get_current_domain() const;
53
54 friend shared_ptr<DomainBase>& get_domain(const shared_ptr<Bead>&, unsigned);
55 friend shared_ptr<DomainBase>& get_current_domain(const shared_ptr<Bead>&);
56
57 int precheck();
58
59 int analyze();
60
61 std::string& variable(const std::string&);
62 std::string replace_variable(std::string_view);
63};
64
65#endif
A Bead class is a top level container.
Definition Bead.h:33
int analyze()
Definition Bead.cpp:73
void erase_domain(unsigned)
Definition Bead.cpp:28
void enable_domain(unsigned)
Definition Bead.cpp:45
unsigned get_current_domain_tag() const
Definition Bead.cpp:51
int precheck()
Definition Bead.cpp:57
friend shared_ptr< DomainBase > & get_domain(const shared_ptr< Bead > &, unsigned)
Definition Bead.cpp:121
bool insert(const shared_ptr< DomainBase > &)
Definition Bead.cpp:26
void disable_domain(unsigned)
Definition Bead.cpp:47
const shared_ptr< DomainBase > & get_current_domain() const
Definition Bead.cpp:55
std::string replace_variable(std::string_view)
Definition Bead.cpp:99
Bead()
Definition Bead.cpp:24
void set_current_domain_tag(unsigned)
Definition Bead.cpp:49
std::string & variable(const std::string &)
Definition Bead.cpp:97
The DomainBase class is a template.
Definition DomainBase.h:96