suanPan
Modifier.h
Go to the documentation of this file.
1
/*******************************************************************************
2
* Copyright (C) 2017-2024 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
Tag
{
37
protected
:
38
uvec
element_tag
;
39
40
std::vector<weak_ptr<Element>>
element_pool
;
41
42
public
:
43
explicit
Modifier
(
44
unsigned
= 0,
// tag
45
uvec&& = {}
// element tags
46
);
47
Modifier
(
const
Modifier
&) =
delete
;
// copy forbidden
48
Modifier
(
Modifier
&&) =
delete
;
// move forbidden
49
Modifier
&
operator=
(
const
Modifier
&) =
delete
;
// assign forbidden
50
Modifier
&
operator=
(
Modifier
&&) =
delete
;
// assign forbidden
51
52
~Modifier
()
override
=
default
;
53
54
[[nodiscard]]
virtual
bool
has_nonviscous
()
const
{
return
false
; }
55
56
virtual
int
initialize
(
const
shared_ptr<DomainBase>&);
57
58
virtual
bool
if_apply
(
const
shared_ptr<DomainBase>&);
59
60
virtual
int
update_status
() = 0;
61
};
62
63
class
ModifierDynamics
:
public
Modifier
{
64
public
:
65
using
Modifier::Modifier
;
66
67
bool
if_apply
(
const
shared_ptr<DomainBase>&)
override
;
68
};
69
70
#endif
71
Element.h
Tag.h
DomainBase
The DomainBase class is a template.
Definition:
DomainBase.h:104
ModifierDynamics
Definition:
Modifier.h:63
ModifierDynamics::if_apply
bool if_apply(const shared_ptr< DomainBase > &) override
Definition:
Modifier.cpp:43
Modifier
A Modifier class.
Definition:
Modifier.h:36
Modifier::operator=
Modifier & operator=(const Modifier &)=delete
Modifier::element_pool
std::vector< weak_ptr< Element > > element_pool
Definition:
Modifier.h:40
Modifier::has_nonviscous
virtual bool has_nonviscous() const
Definition:
Modifier.h:54
Modifier::initialize
virtual int initialize(const shared_ptr< DomainBase > &)
Definition:
Modifier.cpp:26
Modifier::element_tag
uvec element_tag
Definition:
Modifier.h:38
Modifier::Modifier
Modifier(unsigned=0, uvec &&={})
Definition:
Modifier.cpp:22
Modifier::update_status
virtual int update_status()=0
Modifier::operator=
Modifier & operator=(Modifier &&)=delete
Modifier::Modifier
Modifier(Modifier &&)=delete
Modifier::Modifier
Modifier(const Modifier &)=delete
Modifier::~Modifier
~Modifier() override=default
Modifier::if_apply
virtual bool if_apply(const shared_ptr< DomainBase > &)
Definition:
Modifier.cpp:41
Tag
A base Tag class.
Definition:
Tag.h:38
Element
Modifier
Modifier.h
Generated by
1.9.4