Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfVolumeConstraint.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_TFVOLUMECONSTRAINT_H_
26#define _MODELS_VERTEX_SOLVER_ACTORS_TFVOLUMECONSTRAINT_H_
27
29
30
31namespace TissueForge::models::vertex {
32
33
50 struct VolumeConstraint : MeshObjActor {
51
53 FloatP_t lam;
54
56 FloatP_t constr;
57
58 VolumeConstraint(const FloatP_t &_lam=0, const FloatP_t &_constr=0) {
59 lam = _lam;
60 constr = _constr;
61 }
62
64 virtual std::string name() const override { return "VolumeConstraint"; }
65
67 static std::string actorName() { return "VolumeConstraint"; }
68
76 FloatP_t energy(const Body *source, const Vertex *target) override;
77
85 FVector3 force(const Body *source, const Vertex *target) override;
86
92 static VolumeConstraint *fromString(const std::string &str);
93
94 };
95
96}
97
98#endif // _MODELS_VERTEX_SOLVER_ACTORS_TFVOLUMECONSTRAINT_H_
The mesh body is a volume-enclosing object of mesh surfaces.
Definition tfBody.h:59
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
FloatP_t energy(const Body *source, const Vertex *target) override
Calculate the energy of a source object acting on a target object.
virtual std::string name() const override
Definition tfVolumeConstraint.h:64
static std::string actorName()
Definition tfVolumeConstraint.h:67
static VolumeConstraint * fromString(const std::string &str)
Create from a JSON string representation.
FloatP_t lam
Definition tfVolumeConstraint.h:53
FVector3 force(const Body *source, const Vertex *target) override
Calculate the force that a source object exerts on a target object.
FloatP_t constr
Definition tfVolumeConstraint.h:56