Tissue Forge C 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfCPotential.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 _WRAPS_C_TFCPOTENTIAL_H_
26#define _WRAPS_C_TFCPOTENTIAL_H_
27
28#include "tf_port_c.h"
29
30typedef void (*tfPotentialEval_ByParticleHandleFcn)(
31 struct tfPotentialHandle *p,
32 struct tfParticleHandleHandle *part_i,
33 tfFloatP_t *dx,
34 tfFloatP_t r2,
35 tfFloatP_t *e,
36 tfFloatP_t *f
37);
38typedef void (*tfPotentialEval_ByParticlesHandleFcn)(
39 struct tfPotentialHandle *p,
40 struct tfParticleHandleHandle *part_i,
41 struct tfParticleHandleHandle *part_j,
42 tfFloatP_t *dx,
43 tfFloatP_t r2,
44 tfFloatP_t *e,
45 tfFloatP_t *f
46);
47typedef void (*tfPotentialEval_ByParticles3HandleFcn)(
48 struct tfPotentialHandle *p,
49 struct tfParticleHandleHandle *part_i,
50 struct tfParticleHandleHandle *part_j,
51 struct tfParticleHandleHandle *part_k,
52 tfFloatP_t ctheta,
53 tfFloatP_t *e,
54 tfFloatP_t *fi,
55 tfFloatP_t *fk
56);
57typedef void (*tfPotentialEval_ByParticles4HandleFcn)(
58 struct tfPotentialHandle *p,
59 struct tfParticleHandleHandle *part_i,
60 struct tfParticleHandleHandle *part_j,
61 struct tfParticleHandleHandle *part_k,
62 struct tfParticleHandleHandle *part_l,
63 tfFloatP_t cphi,
64 tfFloatP_t *e,
65 tfFloatP_t *fi,
66 tfFloatP_t *fl
67);
68typedef void (*tfPotentialClearHandleFcn)(struct tfPotentialHandle *p);
69
70// Handles
71
72struct CAPI_EXPORT tfPotentialFlagsHandle {
73 unsigned int POTENTIAL_NONE;
74 unsigned int POTENTIAL_LJ126;
75 unsigned int POTENTIAL_EWALD;
76 unsigned int POTENTIAL_COULOMB;
77 unsigned int POTENTIAL_SINGLE;
78 unsigned int POTENTIAL_R2;
79 unsigned int POTENTIAL_R;
80 unsigned int POTENTIAL_ANGLE;
81 unsigned int POTENTIAL_HARMONIC;
82 unsigned int POTENTIAL_DIHEDRAL;
83 unsigned int POTENTIAL_SWITCH;
84 unsigned int POTENTIAL_REACTIVE;
85 unsigned int POTENTIAL_SCALED;
86 unsigned int POTENTIAL_SHIFTED;
87 unsigned int POTENTIAL_BOUND;
88 unsigned int POTENTIAL_SUM;
89 unsigned int POTENTIAL_PERIODIC;
90 unsigned int POTENTIAL_COULOMBR;
91};
92
93struct CAPI_EXPORT tfPotentialKindHandle {
94 unsigned int POTENTIAL_KIND_POTENTIAL;
95 unsigned int POTENTIAL_KIND_DPD;
96 unsigned int POTENTIAL_KIND_BYPARTICLES;
97 unsigned int POTENTIAL_KIND_COMBINATION;
98};
99
105 void *tfObj;
106};
107
113 void *tfObj;
114};
115
121 void *tfObj;
122};
123
129 void *tfObj;
130};
131
136struct CAPI_EXPORT tfPotentialClearHandle {
137 void *tfObj;
138};
139
144struct CAPI_EXPORT tfPotentialHandle {
145 void *tfObj;
146};
147
148
149
151// PotentialFlags //
153
154
161CAPI_FUNC(HRESULT) tfPotentialFlags_init(struct tfPotentialFlagsHandle *handle);
162
163
165// PotentialKind //
167
168
175CAPI_FUNC(HRESULT) tfPotentialKind_init(struct tfPotentialKindHandle *handle);
176
177
179// PotentialEval_ByParticle //
181
182
190CAPI_FUNC(HRESULT) tfPotentialEval_ByParticle_init(struct tfPotentialEval_ByParticleHandle *handle, tfPotentialEval_ByParticleHandleFcn *fcn);
191
199
200
202// PotentialEval_ByParticles //
204
205
213CAPI_FUNC(HRESULT) tfPotentialEval_ByParticles_init(struct tfPotentialEval_ByParticlesHandle *handle, tfPotentialEval_ByParticlesHandleFcn *fcn);
214
222
223
225// PotentialEval_ByParticles3 //
227
228
236CAPI_FUNC(HRESULT) tfPotentialEval_ByParticles3_init(struct tfPotentialEval_ByParticles3Handle *handle, tfPotentialEval_ByParticles3HandleFcn *fcn);
237
245
246
248// PotentialEval_ByParticles4 //
250
251
259CAPI_FUNC(HRESULT) tfPotentialEval_ByParticles4_init(struct tfPotentialEval_ByParticles4Handle *handle, tfPotentialEval_ByParticles4HandleFcn *fcn);
260
268
269
271// PotentialClear //
273
274
282CAPI_FUNC(HRESULT) tfPotentialClear_init(struct tfPotentialClearHandle *handle, tfPotentialClearHandleFcn *fcn);
283
290CAPI_FUNC(HRESULT) tfPotentialClear_destroy(struct tfPotentialClearHandle *handle);
291
292
294// Potential //
296
297
304CAPI_FUNC(HRESULT) tfPotential_destroy(struct tfPotentialHandle *handle);
305
314CAPI_FUNC(HRESULT) tfPotential_getName(struct tfPotentialHandle *handle, char **name, unsigned int *numChars);
315
323CAPI_FUNC(HRESULT) tfPotential_setName(struct tfPotentialHandle *handle, const char *name);
324
332CAPI_FUNC(HRESULT) tfPotential_getFlags(struct tfPotentialHandle *handle, unsigned int *flags);
333
341CAPI_FUNC(HRESULT) tfPotential_setFlags(struct tfPotentialHandle *handle, unsigned int flags);
342
350CAPI_FUNC(HRESULT) tfPotential_getKind(struct tfPotentialHandle *handle, unsigned int *kind);
351
360CAPI_FUNC(HRESULT) tfPotential_evalR(struct tfPotentialHandle *handle, tfFloatP_t r, tfFloatP_t *potE);
361
371CAPI_FUNC(HRESULT) tfPotential_evalR0(struct tfPotentialHandle *handle, tfFloatP_t r, tfFloatP_t r0, tfFloatP_t *potE);
372
381CAPI_FUNC(HRESULT) tfPotential_evalPos(struct tfPotentialHandle *handle, tfFloatP_t *pos, tfFloatP_t *potE);
382
392CAPI_FUNC(HRESULT) tfPotential_evalPart(struct tfPotentialHandle *handle, struct tfParticleHandleHandle *partHandle, tfFloatP_t *pos, tfFloatP_t *potE);
393
403CAPI_FUNC(HRESULT) tfPotential_evalParts2(
404 struct tfPotentialHandle *handle,
405 struct tfParticleHandleHandle *phi,
406 struct tfParticleHandleHandle *phj,
407 tfFloatP_t *potE
408);
409
420CAPI_FUNC(HRESULT) tfPotential_evalParts3(
421 struct tfPotentialHandle *handle,
422 struct tfParticleHandleHandle *phi,
423 struct tfParticleHandleHandle *phj,
424 struct tfParticleHandleHandle *phk,
425 tfFloatP_t *potE
426);
427
439CAPI_FUNC(HRESULT) tfPotential_evalParts4(
440 struct tfPotentialHandle *handle,
441 struct tfParticleHandleHandle *phi,
442 struct tfParticleHandleHandle *phj,
443 struct tfParticleHandleHandle *phk,
444 struct tfParticleHandleHandle *phl,
445 tfFloatP_t *potE
446);
447
456CAPI_FUNC(HRESULT) tfPotential_fevalR(struct tfPotentialHandle *handle, tfFloatP_t r, tfFloatP_t *force);
457
467CAPI_FUNC(HRESULT) tfPotential_fevalR0(struct tfPotentialHandle *handle, tfFloatP_t r, tfFloatP_t r0, tfFloatP_t *force);
468
477CAPI_FUNC(HRESULT) tfPotential_fevalPos(struct tfPotentialHandle *handle, tfFloatP_t *pos, tfFloatP_t **force);
478
488CAPI_FUNC(HRESULT) tfPotential_fevalPart(struct tfPotentialHandle *handle, struct tfParticleHandleHandle *partHandle, tfFloatP_t *pos, tfFloatP_t **force);
489
499CAPI_FUNC(HRESULT) tfPotential_fevalParts2(
500 struct tfPotentialHandle *handle,
501 struct tfParticleHandleHandle *phi,
502 struct tfParticleHandleHandle *phj,
503 tfFloatP_t **force
504);
505
517CAPI_FUNC(HRESULT) tfPotential_fevalParts3(
518 struct tfPotentialHandle *handle,
519 struct tfParticleHandleHandle *phi,
520 struct tfParticleHandleHandle *phj,
521 struct tfParticleHandleHandle *phk,
522 tfFloatP_t **forcei,
523 tfFloatP_t **forcek
524);
525
538CAPI_FUNC(HRESULT) tfPotential_fevalParts4(
539 struct tfPotentialHandle *handle,
540 struct tfParticleHandleHandle *phi,
541 struct tfParticleHandleHandle *phj,
542 struct tfParticleHandleHandle *phk,
543 struct tfParticleHandleHandle *phl,
544 tfFloatP_t **forcei,
545 tfFloatP_t **forcel
546);
547
556CAPI_FUNC(HRESULT) tfPotential_getConstituents(struct tfPotentialHandle *handle, struct tfPotentialHandle ***chandles, unsigned int *numPots);
557
565CAPI_FUNC(HRESULT) tfPotential_toString(struct tfPotentialHandle *handle, char **str, unsigned int *numChars);
566
572CAPI_FUNC(HRESULT) tfPotential_fromString(struct tfPotentialHandle *handle, const char *str);
573
581CAPI_FUNC(HRESULT) tfPotential_setClearFcn(struct tfPotentialHandle *handle, struct tfPotentialClearHandle *fcn);
582
589CAPI_FUNC(HRESULT) tfPotential_removeClearFcn(struct tfPotentialHandle *handle);
590
598CAPI_FUNC(HRESULT) tfPotential_hasClearFcn(struct tfPotentialHandle *handle, bool *hasClear);
599
607CAPI_FUNC(HRESULT) tfPotential_getMin(struct tfPotentialHandle *handle, tfFloatP_t *minR);
608
616CAPI_FUNC(HRESULT) tfPotential_getMax(struct tfPotentialHandle *handle, tfFloatP_t *maxR);
617
625CAPI_FUNC(HRESULT) tfPotential_getBound(struct tfPotentialHandle *handle, bool *bound);
626
634CAPI_FUNC(HRESULT) tfPotential_setBound(struct tfPotentialHandle *handle, bool bound);
635
643CAPI_FUNC(HRESULT) tfPotential_getR0(struct tfPotentialHandle *handle, tfFloatP_t *r0);
644
652CAPI_FUNC(HRESULT) tfPotential_setR0(struct tfPotentialHandle *handle, tfFloatP_t r0);
653
661CAPI_FUNC(HRESULT) tfPotential_getRSquare(struct tfPotentialHandle *handle, tfFloatP_t *r2);
662
670CAPI_FUNC(HRESULT) tfPotential_getShifted(struct tfPotentialHandle *handle, bool *shifted);
671
679CAPI_FUNC(HRESULT) tfPotential_getPeriodic(struct tfPotentialHandle *handle, bool *periodic);
680
700CAPI_FUNC(HRESULT) tfPotential_create_lennard_jones_12_6(struct tfPotentialHandle *handle, tfFloatP_t min, tfFloatP_t max, tfFloatP_t A, tfFloatP_t B, tfFloatP_t *tol);
701
722CAPI_FUNC(HRESULT) tfPotential_create_lennard_jones_12_6_coulomb(struct tfPotentialHandle *handle, tfFloatP_t min, tfFloatP_t max, tfFloatP_t A, tfFloatP_t B, tfFloatP_t q, tfFloatP_t *tol);
723
744CAPI_FUNC(HRESULT) tfPotential_create_ewald(struct tfPotentialHandle *handle, tfFloatP_t min, tfFloatP_t max, tfFloatP_t q, tfFloatP_t kappa, tfFloatP_t *tol, unsigned int *periodicOrder);
745
765CAPI_FUNC(HRESULT) tfPotential_create_coulomb(struct tfPotentialHandle *handle, tfFloatP_t q, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol, unsigned int *periodicOrder);
766
788CAPI_FUNC(HRESULT) tfPotential_create_coulombR(struct tfPotentialHandle *handle, tfFloatP_t q, tfFloatP_t kappa, tfFloatP_t min, tfFloatP_t max, unsigned int* modes);
789
809CAPI_FUNC(HRESULT) tfPotential_create_harmonic(struct tfPotentialHandle *handle, tfFloatP_t k, tfFloatP_t r0, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol);
810
829CAPI_FUNC(HRESULT) tfPotential_create_linear(struct tfPotentialHandle *handle, tfFloatP_t k, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol);
830
850CAPI_FUNC(HRESULT) tfPotential_create_harmonic_angle(struct tfPotentialHandle *handle, tfFloatP_t k, tfFloatP_t theta0, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol);
851
871CAPI_FUNC(HRESULT) tfPotential_create_harmonic_dihedral(struct tfPotentialHandle *handle, tfFloatP_t k, tfFloatP_t delta, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol);
872
891CAPI_FUNC(HRESULT) tfPotential_create_cosine_dihedral(struct tfPotentialHandle *handle, tfFloatP_t k, int n, tfFloatP_t delta, tfFloatP_t *tol);
892
915CAPI_FUNC(HRESULT) tfPotential_create_well(struct tfPotentialHandle *handle, tfFloatP_t k, tfFloatP_t n, tfFloatP_t r0, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol);
916
940CAPI_FUNC(HRESULT) tfPotential_create_glj(struct tfPotentialHandle *handle, tfFloatP_t e, tfFloatP_t *m, tfFloatP_t *n, tfFloatP_t *k, tfFloatP_t *r0, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol, bool *shifted);
941
962CAPI_FUNC(HRESULT) tfPotential_create_morse(struct tfPotentialHandle *handle, tfFloatP_t *d, tfFloatP_t *a, tfFloatP_t *r0, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol);
963
1002CAPI_FUNC(HRESULT) tfPotential_create_overlapping_sphere(struct tfPotentialHandle *handle, tfFloatP_t *mu, tfFloatP_t *kc, tfFloatP_t *kh, tfFloatP_t *r0, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol);
1003
1025CAPI_FUNC(HRESULT) tfPotential_create_power(struct tfPotentialHandle *handle, tfFloatP_t *k, tfFloatP_t *r0, tfFloatP_t *alpha, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol);
1026
1070CAPI_FUNC(HRESULT) tfPotential_create_dpd(struct tfPotentialHandle *handle, tfFloatP_t *alpha, tfFloatP_t *gamma, tfFloatP_t *sigma, tfFloatP_t *cutoff, bool *shifted);
1071
1085CAPI_FUNC(HRESULT) tfPotential_create_custom(
1086 struct tfPotentialHandle *handle,
1087 tfFloatP_t min,
1088 tfFloatP_t max,
1089 tfFloatP_t (*f)(tfFloatP_t),
1090 tfFloatP_t (*fp)(tfFloatP_t),
1091 tfFloatP_t (*f6p)(tfFloatP_t),
1092 tfFloatP_t *tol,
1093 unsigned int *flags
1094);
1095
1104
1113
1122
1131
1132
1134// Module functions //
1136
1137
1146CAPI_FUNC(HRESULT) tfPotential_add(struct tfPotentialHandle *handlei, struct tfPotentialHandle *handlej, struct tfPotentialHandle *handleSum);
1147
1148#endif // _WRAPS_C_TFCPOTENTIAL_H_
Handle to a ParticleHandle instance.
Definition tfCParticle.h:111
Handle to a PotentialClear instance.
Definition tfCPotential.h:136
Handle to a PotentialEval_ByParticle instance.
Definition tfCPotential.h:104
Handle to a PotentialEval_ByParticles3 instance.
Definition tfCPotential.h:120
Handle to a PotentialEval_ByParticles4 instance.
Definition tfCPotential.h:128
Handle to a PotentialEval_ByParticles instance.
Definition tfCPotential.h:112
Definition tfCPotential.h:72
Handle to a Potential instance.
Definition tfCPotential.h:144
Definition tfCPotential.h:93
HRESULT tfPotential_create_cosine_dihedral(struct tfPotentialHandle *handle, tfFloatP_t k, int n, tfFloatP_t delta, tfFloatP_t *tol)
Creates a cosine dihedral potential.
HRESULT tfPotential_getConstituents(struct tfPotentialHandle *handle, struct tfPotentialHandle ***chandles, unsigned int *numPots)
Get the constituent potentials.
HRESULT tfPotentialEval_ByParticles4_init(struct tfPotentialEval_ByParticles4Handle *handle, tfPotentialEval_ByParticles4HandleFcn *fcn)
Initialize an instance.
HRESULT tfPotential_fevalPos(struct tfPotentialHandle *handle, tfFloatP_t *pos, tfFloatP_t **force)
Evaluate the force for a given position.
HRESULT tfPotential_create_ewald(struct tfPotentialHandle *handle, tfFloatP_t min, tfFloatP_t max, tfFloatP_t q, tfFloatP_t kappa, tfFloatP_t *tol, unsigned int *periodicOrder)
Creates a real-space Ewald potential.
HRESULT tfPotential_setClearFcn(struct tfPotentialHandle *handle, struct tfPotentialClearHandle *fcn)
Set the clear function.
HRESULT tfPotential_create_lennard_jones_12_6(struct tfPotentialHandle *handle, tfFloatP_t min, tfFloatP_t max, tfFloatP_t A, tfFloatP_t B, tfFloatP_t *tol)
Creates a 12-6 Lennard-Jones potential.
HRESULT tfPotential_removeClearFcn(struct tfPotentialHandle *handle)
Remove the clear function.
HRESULT tfPotentialKind_init(struct tfPotentialKindHandle *handle)
Initialize an instance.
HRESULT tfPotential_create_glj(struct tfPotentialHandle *handle, tfFloatP_t e, tfFloatP_t *m, tfFloatP_t *n, tfFloatP_t *k, tfFloatP_t *r0, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol, bool *shifted)
Creates a generalized Lennard-Jones potential.
HRESULT tfPotential_create_lennard_jones_12_6_coulomb(struct tfPotentialHandle *handle, tfFloatP_t min, tfFloatP_t max, tfFloatP_t A, tfFloatP_t B, tfFloatP_t q, tfFloatP_t *tol)
Creates a potential of the sum of a 12-6 Lennard-Jones potential and a shifted Coulomb potential.
HRESULT tfPotential_fevalParts3(struct tfPotentialHandle *handle, struct tfParticleHandleHandle *phi, struct tfParticleHandleHandle *phj, struct tfParticleHandleHandle *phk, tfFloatP_t **forcei, tfFloatP_t **forcek)
Evalute the forces for three particles.
HRESULT tfPotential_create_eval_ByParticles4(struct tfPotentialHandle *handle, struct tfPotentialEval_ByParticles4Handle *fcn)
Create a potential that uses an evaluation function by four particles.
HRESULT tfPotential_create_coulomb(struct tfPotentialHandle *handle, tfFloatP_t q, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol, unsigned int *periodicOrder)
Creates a Coulomb potential.
HRESULT tfPotentialEval_ByParticles4_destroy(struct tfPotentialEval_ByParticles4Handle *handle)
Destroy an instance.
HRESULT tfPotential_setName(struct tfPotentialHandle *handle, const char *name)
Set the name of the potential.
HRESULT tfPotential_evalParts2(struct tfPotentialHandle *handle, struct tfParticleHandleHandle *phi, struct tfParticleHandleHandle *phj, tfFloatP_t *potE)
Evalute the potential for two particles.
HRESULT tfPotential_destroy(struct tfPotentialHandle *handle)
Destroy an instance.
HRESULT tfPotential_setBound(struct tfPotentialHandle *handle, bool bound)
Set whether the potential is bound.
HRESULT tfPotential_getFlags(struct tfPotentialHandle *handle, unsigned int *flags)
Get the flags of the potential.
HRESULT tfPotential_fromString(struct tfPotentialHandle *handle, const char *str)
Create from a JSON string representation.
HRESULT tfPotential_evalPart(struct tfPotentialHandle *handle, struct tfParticleHandleHandle *partHandle, tfFloatP_t *pos, tfFloatP_t *potE)
Evaluate the potential for a given particle and position.
HRESULT tfPotentialEval_ByParticles_init(struct tfPotentialEval_ByParticlesHandle *handle, tfPotentialEval_ByParticlesHandleFcn *fcn)
Initialize an instance.
HRESULT tfPotential_getBound(struct tfPotentialHandle *handle, bool *bound)
Get whether the potential is bound.
HRESULT tfPotential_create_eval_ByParticles3(struct tfPotentialHandle *handle, struct tfPotentialEval_ByParticles3Handle *fcn)
Create a potential that uses an evaluation function by three particles.
HRESULT tfPotentialEval_ByParticles3_destroy(struct tfPotentialEval_ByParticles3Handle *handle)
Destroy an instance.
HRESULT tfPotential_setFlags(struct tfPotentialHandle *handle, unsigned int flags)
Set the flags of the potential.
HRESULT tfPotentialClear_destroy(struct tfPotentialClearHandle *handle)
Destroy an instance.
HRESULT tfPotential_fevalParts4(struct tfPotentialHandle *handle, struct tfParticleHandleHandle *phi, struct tfParticleHandleHandle *phj, struct tfParticleHandleHandle *phk, struct tfParticleHandleHandle *phl, tfFloatP_t **forcei, tfFloatP_t **forcel)
Evalute the forces for four particles.
HRESULT tfPotential_evalPos(struct tfPotentialHandle *handle, tfFloatP_t *pos, tfFloatP_t *potE)
Evaluate the potential for a given position.
HRESULT tfPotential_setR0(struct tfPotentialHandle *handle, tfFloatP_t r0)
Set the equilibrium distance of the potential.
HRESULT tfPotential_create_eval_ByParticle(struct tfPotentialHandle *handle, struct tfPotentialEval_ByParticleHandle *fcn)
Create a potential that uses an evaluation function by particle.
HRESULT tfPotential_create_harmonic_dihedral(struct tfPotentialHandle *handle, tfFloatP_t k, tfFloatP_t delta, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol)
Creates a harmonic dihedral potential.
HRESULT tfPotential_hasClearFcn(struct tfPotentialHandle *handle, bool *hasClear)
Test whether a potential has a clear function.
HRESULT tfPotential_create_dpd(struct tfPotentialHandle *handle, tfFloatP_t *alpha, tfFloatP_t *gamma, tfFloatP_t *sigma, tfFloatP_t *cutoff, bool *shifted)
Creates a Dissipative Particle Dynamics potential.
HRESULT tfPotential_create_morse(struct tfPotentialHandle *handle, tfFloatP_t *d, tfFloatP_t *a, tfFloatP_t *r0, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol)
Creates a Morse potential.
HRESULT tfPotential_toString(struct tfPotentialHandle *handle, char **str, unsigned int *numChars)
Get a JSON string representation.
HRESULT tfPotential_create_linear(struct tfPotentialHandle *handle, tfFloatP_t k, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol)
Creates a linear potential.
HRESULT tfPotential_create_well(struct tfPotentialHandle *handle, tfFloatP_t k, tfFloatP_t n, tfFloatP_t r0, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol)
Creates a well potential.
HRESULT tfPotential_create_eval_ByParticles(struct tfPotentialHandle *handle, struct tfPotentialEval_ByParticlesHandle *fcn)
Create a potential that uses an evaluation function by two particles.
HRESULT tfPotential_fevalR(struct tfPotentialHandle *handle, tfFloatP_t r, tfFloatP_t *force)
Evaluate the force.
HRESULT tfPotential_create_harmonic(struct tfPotentialHandle *handle, tfFloatP_t k, tfFloatP_t r0, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol)
Creates a harmonic bond potential.
HRESULT tfPotential_evalR0(struct tfPotentialHandle *handle, tfFloatP_t r, tfFloatP_t r0, tfFloatP_t *potE)
Evaluate the potential for a given scaling distance.
HRESULT tfPotential_create_harmonic_angle(struct tfPotentialHandle *handle, tfFloatP_t k, tfFloatP_t theta0, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol)
Creates a harmonic angle potential.
HRESULT tfPotential_fevalPart(struct tfPotentialHandle *handle, struct tfParticleHandleHandle *partHandle, tfFloatP_t *pos, tfFloatP_t **force)
Evaluate the force for a given particle and position.
HRESULT tfPotential_getR0(struct tfPotentialHandle *handle, tfFloatP_t *r0)
Get the equilibrium distance of the potential.
HRESULT tfPotential_fevalParts2(struct tfPotentialHandle *handle, struct tfParticleHandleHandle *phi, struct tfParticleHandleHandle *phj, tfFloatP_t **force)
Evalute the force for two particles.
HRESULT tfPotential_create_coulombR(struct tfPotentialHandle *handle, tfFloatP_t q, tfFloatP_t kappa, tfFloatP_t min, tfFloatP_t max, unsigned int *modes)
Creates a Coulomb reciprocal potential.
HRESULT tfPotential_getKind(struct tfPotentialHandle *handle, unsigned int *kind)
Get the kind of the potential.
HRESULT tfPotentialClear_init(struct tfPotentialClearHandle *handle, tfPotentialClearHandleFcn *fcn)
Initialize an instance.
HRESULT tfPotential_getRSquare(struct tfPotentialHandle *handle, tfFloatP_t *r2)
Get the equilibrium distance of the potential.
HRESULT tfPotentialFlags_init(struct tfPotentialFlagsHandle *handle)
Initialize an instance.
HRESULT tfPotentialEval_ByParticle_init(struct tfPotentialEval_ByParticleHandle *handle, tfPotentialEval_ByParticleHandleFcn *fcn)
Initialize an instance.
HRESULT tfPotential_getMax(struct tfPotentialHandle *handle, tfFloatP_t *maxR)
Get the maximum distance for which a potential is evaluated.
HRESULT tfPotential_getName(struct tfPotentialHandle *handle, char **name, unsigned int *numChars)
Get the name of the potential.
HRESULT tfPotential_add(struct tfPotentialHandle *handlei, struct tfPotentialHandle *handlej, struct tfPotentialHandle *handleSum)
Add two potentials.
HRESULT tfPotentialEval_ByParticles_destroy(struct tfPotentialEval_ByParticlesHandle *handle)
Destroy an instance.
HRESULT tfPotential_evalParts4(struct tfPotentialHandle *handle, struct tfParticleHandleHandle *phi, struct tfParticleHandleHandle *phj, struct tfParticleHandleHandle *phk, struct tfParticleHandleHandle *phl, tfFloatP_t *potE)
Evalute the potential for four particles.
HRESULT tfPotential_create_power(struct tfPotentialHandle *handle, tfFloatP_t *k, tfFloatP_t *r0, tfFloatP_t *alpha, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol)
Creates a power potential.
HRESULT tfPotentialEval_ByParticles3_init(struct tfPotentialEval_ByParticles3Handle *handle, tfPotentialEval_ByParticles3HandleFcn *fcn)
Initialize an instance.
HRESULT tfPotential_create_overlapping_sphere(struct tfPotentialHandle *handle, tfFloatP_t *mu, tfFloatP_t *kc, tfFloatP_t *kh, tfFloatP_t *r0, tfFloatP_t *min, tfFloatP_t *max, tfFloatP_t *tol)
Creates an overlapping-sphere potential from :cite:Osborne:2017hk.
HRESULT tfPotential_evalParts3(struct tfPotentialHandle *handle, struct tfParticleHandleHandle *phi, struct tfParticleHandleHandle *phj, struct tfParticleHandleHandle *phk, tfFloatP_t *potE)
Evalute the potential for three particles.
HRESULT tfPotential_getMin(struct tfPotentialHandle *handle, tfFloatP_t *minR)
Get the minimum distance for which a potential is evaluated.
HRESULT tfPotential_evalR(struct tfPotentialHandle *handle, tfFloatP_t r, tfFloatP_t *potE)
Evaluate the potential.
HRESULT tfPotential_create_custom(struct tfPotentialHandle *handle, tfFloatP_t min, tfFloatP_t max, tfFloatP_t(*f)(tfFloatP_t), tfFloatP_t(*fp)(tfFloatP_t), tfFloatP_t(*f6p)(tfFloatP_t), tfFloatP_t *tol, unsigned int *flags)
Creates a custom potential.
HRESULT tfPotential_fevalR0(struct tfPotentialHandle *handle, tfFloatP_t r, tfFloatP_t r0, tfFloatP_t *force)
Evaluate the force for a given scaling distance.
HRESULT tfPotential_getShifted(struct tfPotentialHandle *handle, bool *shifted)
Get whether the potential is shifted.
HRESULT tfPotential_getPeriodic(struct tfPotentialHandle *handle, bool *periodic)
Get whether the potential is periodic.
HRESULT tfPotentialEval_ByParticle_destroy(struct tfPotentialEval_ByParticleHandle *handle)
Destroy an instance.