Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tf_metrics.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
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 _SOURCE_TF_METRICS_H_
26#define _SOURCE_TF_METRICS_H_
27
28#include "TissueForge_private.h"
29#include "tfParticle.h"
30#include <set>
31#include <vector>
32
33
35
36
49 CPPAPI_FUNC(FVector3) relativePosition(const FVector3 &pos, const FVector3 &origin, const bool &comp_bc=true);
50
54 CPPAPI_FUNC(ParticleList) neighborhoodParticles(const FVector3 &position, const FloatP_t &dist, const bool &comp_bc=true);
55
69 FloatP_t *origin,
70 FloatP_t radius,
71 const std::set<short int> &typeIds,
72 FloatP_t *tensor
73 );
74
83 int32_t *parts,
84 uint16_t nr_parts,
85 uint32_t flags,
86 FloatP_t *tensor
87 );
88
92 CAPI_FUNC(HRESULT) particlesRadiusOfGyration(int32_t *parts, uint16_t nr_parts, FloatP_t* result);
93
97 CAPI_FUNC(HRESULT) particlesCenterOfMass(int32_t *parts, uint16_t nr_parts, FloatP_t* result);
98
102 CAPI_FUNC(HRESULT) particlesCenterOfGeometry(int32_t *parts, uint16_t nr_parts, FloatP_t* result);
103
107 CAPI_FUNC(HRESULT) particlesMomentOfInertia(int32_t *parts, uint16_t nr_parts, FloatP_t* result);
108
114 CPPAPI_FUNC(FVector3) cartesianToSpherical(const FVector3& postion, const FVector3& origin);
115
128 struct Particle *part,
129 FloatP_t radius,
130 const std::set<short int> *typeIds,
131 uint16_t *nr_parts,
132 int32_t **parts
133 );
134
135
139 std::vector<std::vector<std::vector<ParticleList> > > particleGrid(const iVector3 &shape);
140
141 CAPI_FUNC(HRESULT) particleGrid(const iVector3 &shape, ParticleList *result);
142
150 CPPAPI_FUNC(FVector3) eigenVals(const FMatrix3 &mat, const bool &symmetric=false);
151
159 CPPAPI_FUNC(FVector4) eigenVals(const FMatrix4 &mat, const bool &symmetric=false);
160
168 CPPAPI_FUNC(std::pair<FVector3, FMatrix3>) eigenVecsVals(const FMatrix3 &mat, const bool &symmetric=false);
169
177 CPPAPI_FUNC(std::pair<FVector4, FMatrix4>) eigenVecsVals(const FMatrix4 &mat, const bool &symmetric=false);
178
179};
180
181
182#endif // _SOURCE_TF_METRICS_H_
Definition tfMatrix3.h:35
Definition tfMatrix4.h:35
Definition tfVector4.h:33
Tissue Forge simulation metrics.
Definition tf_metrics.h:34
FVector3 eigenVals(const FMatrix3 &mat, const bool &symmetric=false)
Compute the eigenvalues of a 3x3 matrix.
HRESULT calculateVirial(FloatP_t *origin, FloatP_t radius, const std::set< short int > &typeIds, FloatP_t *tensor)
HRESULT particlesRadiusOfGyration(int32_t *parts, uint16_t nr_parts, FloatP_t *result)
HRESULT particleNeighbors(struct Particle *part, FloatP_t radius, const std::set< short int > *typeIds, uint16_t *nr_parts, int32_t **parts)
HRESULT particlesCenterOfGeometry(int32_t *parts, uint16_t nr_parts, FloatP_t *result)
HRESULT particlesVirial(int32_t *parts, uint16_t nr_parts, uint32_t flags, FloatP_t *tensor)
HRESULT particlesCenterOfMass(int32_t *parts, uint16_t nr_parts, FloatP_t *result)
ParticleList neighborhoodParticles(const FVector3 &position, const FloatP_t &dist, const bool &comp_bc=true)
std::vector< std::vector< std::vector< ParticleList > > > particleGrid(const iVector3 &shape)
FVector3 relativePosition(const FVector3 &pos, const FVector3 &origin, const bool &comp_bc=true)
Computes the relative position with respect to an origin while optionally account for boundary condit...
std::pair< FVector3 FMatrix3 > eigenVecsVals(const FMatrix3 &mat, const bool &symmetric=false)
Compute the eigenvectors and eigenvalues of a 3x3 matrix.
HRESULT particlesMomentOfInertia(int32_t *parts, uint16_t nr_parts, FloatP_t *result)
FVector3 cartesianToSpherical(const FVector3 &postion, const FVector3 &origin)
Definition tfParticle.h:101
A special list with convenience methods for working with sets of particles.
Definition tfParticleList.h:52
int32_t HRESULT
Definition tf_port.h:255