suanPan
Loading...
Searching...
No Matches
Modifier.h
Go to the documentation of this file.
1
/*******************************************************************************
2
* Copyright (C) 2017-2025 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
******************************************************************************/
28
#ifndef MODIFIER_H
29
#define MODIFIER_H
30
31
#include <
Domain/Tag.h
>
32
#include <
Element/Element.h
>
33
34
class
DomainBase
;
35
36
class
Modifier
:
public
UniqueTag
{
37
protected
:
38
uvec
element_tag
;
39
40
std::vector<std::weak_ptr<Element>>
element_pool
;
41
42
public
:
43
explicit
Modifier
(
44
unsigned
= 0,
// tag
45
uvec&& = {}
// element tags
46
);
47
48
[[nodiscard]]
virtual
bool
has_nonviscous
()
const
{
return
false
; }
49
50
virtual
int
initialize
(
const
shared_ptr<DomainBase>&);
51
52
virtual
bool
if_apply
(
const
shared_ptr<DomainBase>&);
53
54
virtual
int
update_status
() = 0;
55
};
56
57
class
ModifierDynamics
:
public
Modifier
{
58
public
:
59
using
Modifier::Modifier
;
60
61
bool
if_apply
(
const
shared_ptr<DomainBase>&)
override
;
62
};
63
64
#endif
65
Element.h
Tag.h
DomainBase
The DomainBase class is a template.
Definition
DomainBase.h:102
ModifierDynamics
Definition
Modifier.h:57
ModifierDynamics::if_apply
bool if_apply(const shared_ptr< DomainBase > &) override
Definition
Modifier.cpp:47
Modifier
A Modifier class.
Definition
Modifier.h:36
Modifier::has_nonviscous
virtual bool has_nonviscous() const
Definition
Modifier.h:48
Modifier::initialize
virtual int initialize(const shared_ptr< DomainBase > &)
Definition
Modifier.cpp:27
Modifier::element_tag
uvec element_tag
Definition
Modifier.h:38
Modifier::Modifier
Modifier(unsigned=0, uvec &&={})
Definition
Modifier.cpp:23
Modifier::update_status
virtual int update_status()=0
Modifier::element_pool
std::vector< std::weak_ptr< Element > > element_pool
Definition
Modifier.h:40
Modifier::if_apply
virtual bool if_apply(const shared_ptr< DomainBase > &)
Definition
Modifier.cpp:45
UniqueTag
Definition
Tag.h:77
Element
Modifier
Modifier.h
Generated by
1.9.8