suanPan
🧮 An Open Source, Parallel and Heterogeneous Finite Element Analysis Framework
Loading...
Searching...
No Matches
ExternalMaterial.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 ******************************************************************************/
50#ifndef EXTERNALMATERIAL_H
51#define EXTERNALMATERIAL_H
52
54
55#include <Material/Material.h>
56
57class ExternalMaterial final : public Material {
58 static MaterialType get_type(const ExternalMaterialData&);
59
60 using Interface = void (*)(ExternalMaterialData*, int*);
61
62 std::vector<double> constant;
63
64 Interface cooker;
65
67
68public:
70 unsigned, // unique material tag
71 std::vector<double>&&, // parameter pool
72 void* // handler pointer
73 );
78 ~ExternalMaterial() override;
79
80 bool validate();
81
82 int initialize(const shared_ptr<DomainBase>&) override;
83
84 void initialize_history(unsigned) override;
85 void set_initial_history(const vec&) override;
86
87 unique_ptr<Material> unique_copy() override;
88
89 int update_trial_status(const vec&) override;
90 int update_trial_status(const vec&, const vec&) override;
91
92 int commit_status() override;
93 int reset_status() override;
94 int clear_status() override;
95
96 [[nodiscard]] std::vector<vec> record(OutputType) const override;
97};
98
99#endif
100
OutputType
Definition OutputType.h:23
A ExternalMaterial class.
Definition ExternalMaterial.h:57
ExternalMaterial(ExternalMaterial &&)=delete
void initialize_history(unsigned) override
Definition ExternalMaterial.cpp:96
std::vector< vec > record(OutputType) const override
Definition ExternalMaterial.cpp:151
ExternalMaterial & operator=(const ExternalMaterial &)=delete
unique_ptr< Material > unique_copy() override
Definition ExternalMaterial.cpp:100
int update_trial_status(const vec &) override
Definition ExternalMaterial.cpp:102
void set_initial_history(const vec &) override
Definition ExternalMaterial.cpp:98
int initialize(const shared_ptr< DomainBase > &) override
Definition ExternalMaterial.cpp:72
bool validate()
Definition ExternalMaterial.cpp:64
int reset_status() override
Definition ExternalMaterial.cpp:135
~ExternalMaterial() override
Definition ExternalMaterial.cpp:58
ExternalMaterial & operator=(ExternalMaterial &&)=delete
int clear_status() override
Definition ExternalMaterial.cpp:143
int commit_status() override
Definition ExternalMaterial.cpp:127
A Material abstract base class.
Definition Material.h:114
MaterialType
Definition Material.h:37
A ExternalMaterialData class.
Definition ExternalMaterialData.h:51