Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfEdgeTension.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
25#ifndef _MODELS_VERTEX_SOLVER_ACTORS_TFEDGETENSION_H_
26#define _MODELS_VERTEX_SOLVER_ACTORS_TFEDGETENSION_H_
27
29
30
31namespace TissueForge::models::vertex {
32
33
34 typedef FloatP_t (*EdgeTensionEnergyFcn)(const Surface*, const Vertex*, const FloatP_t&, const unsigned int&);
35 typedef FVector3 (*EdgeTensionForceFcn)(const Surface*, const Vertex*, const FloatP_t&, const unsigned int&);
36
37
54
56 FloatP_t lam;
57
59 unsigned int order;
60
61 EdgeTension(const FloatP_t &lam=0, const unsigned int &order=1);
62
64 virtual std::string name() const override { return "EdgeTension"; }
65
67 static std::string actorName() { return "EdgeTension"; }
68
76 FloatP_t energy(const Surface *source, const Vertex *target) override;
77
85 FVector3 force(const Surface *source, const Vertex *target) override;
86
92 static EdgeTension *fromString(const std::string &str);
93
94 private:
95
96 EdgeTensionEnergyFcn energyFcn;
97 EdgeTensionForceFcn forceFcn;
98 };
99
100}
101
102#endif // _MODELS_VERTEX_SOLVER_ACTORS_TFEDGETENSION_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
Models tension between connected vertices.
Definition tfEdgeTension.h:53
unsigned int order
Definition tfEdgeTension.h:59
static EdgeTension * fromString(const std::string &str)
Create from a JSON string representation.
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 tfEdgeTension.h:67
virtual std::string name() const override
Definition tfEdgeTension.h:64
FloatP_t energy(const Surface *source, const Vertex *target) override
Calculate the energy of a source object acting on a target object.
FloatP_t lam
Definition tfEdgeTension.h:56
Base definition of how a mesh object acts on another mesh object.
Definition tfMeshObj.h:97