Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfNormalStress.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of Tissue Forge.
3 * Copyright (c) 2022-2024 T.J. Sego and Tien Comlekoglu
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 ******************************************************************************/
19
24
25#ifndef _MODELS_VERTEX_SOLVER_ACTORS_TFSURFACENORMAL_H_
26#define _MODELS_VERTEX_SOLVER_ACTORS_TFSURFACENORMAL_H_
27
29
30#include <types/tf_types.h>
31
32
33namespace TissueForge::models::vertex {
34
35
39 struct NormalStress : MeshObjActor {
40
42 FloatP_t mag;
43
44 NormalStress(const FloatP_t &_mag=0) {
45 mag = _mag;
46 }
47
49 virtual std::string name() const override { return "NormalStress"; }
50
52 static std::string actorName() { return "NormalStress"; }
53
61 FloatP_t energy(const Surface *source, const Vertex *target) override;
62
70 FVector3 force(const Surface *source, const Vertex *target) override;
71
77 static NormalStress *fromString(const std::string &str);
78
79 };
80
81}
82
83#endif // _MODELS_VERTEX_SOLVER_ACTORS_TFSURFACENORMAL_H_
The mesh surface is an area-enclosed object of implicit mesh edges defined by mesh vertices.
Definition tfSurface.h:65
The mesh vertex is a volume of a mesh centered at a point in a space.
Definition tfVertex.h:71
Base definition of how a mesh object acts on another mesh object.
Definition tfMeshObj.h:97
FVector3 force(const Surface *source, const Vertex *target) override
Calculate the force that a source object exerts on a target object.
static std::string actorName()
Definition tfNormalStress.h:52
static NormalStress * fromString(const std::string &str)
Create from a JSON string representation.
FloatP_t mag
Definition tfNormalStress.h:42
FloatP_t energy(const Surface *source, const Vertex *target) override
Calculate the energy of a source object acting on a target object.
virtual std::string name() const override
Definition tfNormalStress.h:49