Tissue Forge C 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfCUniverse.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_TFCUNIVERSE_H_
26#define _WRAPS_C_TFCUNIVERSE_H_
27
28#include "tf_port_c.h"
29
30#include "tfCParticle.h"
32
33// Handles
34
39struct CAPI_EXPORT tfUniverseConfigHandle {
40 void *tfObj;
41};
42
43
45// Universe //
47
48
55CAPI_FUNC(HRESULT) tfUniverse_getDim(tfFloatP_t **dim);
56
63CAPI_FUNC(HRESULT) tfUniverse_getIsRunning(bool *isRunning);
64
72CAPI_FUNC(HRESULT) tfUniverse_getName(char **name, unsigned int *numChars);
73
80CAPI_FUNC(HRESULT) tfUniverse_getVirial(tfFloatP_t **virial);
81
90CAPI_FUNC(HRESULT) tfUniverse_getVirialT(struct tfParticleTypeHandle **phandles, unsigned int numTypes, tfFloatP_t **virial);
91
100CAPI_FUNC(HRESULT) tfUniverse_getVirialO(tfFloatP_t *origin, tfFloatP_t radius, tfFloatP_t **virial);
101
112CAPI_FUNC(HRESULT) tfUniverse_getVirialOT(
113 struct tfParticleTypeHandle **phandles,
114 unsigned int numTypes,
115 tfFloatP_t *origin,
116 tfFloatP_t radius,
117 tfFloatP_t **virial
118);
119
126CAPI_FUNC(HRESULT) tfUniverse_getNumParts(unsigned int *numParts);
127
135CAPI_FUNC(HRESULT) tfUniverse_getParticle(unsigned int pidx, struct tfParticleHandleHandle *handle);
136
143CAPI_FUNC(HRESULT) tfUniverse_getCenter(tfFloatP_t **center);
144
153CAPI_FUNC(HRESULT) tfUniverse_step(tfFloatP_t until, tfFloatP_t dt);
154
161CAPI_FUNC(HRESULT) tfUniverse_stop();
162
170CAPI_FUNC(HRESULT) tfUniverse_start();
171
177CAPI_FUNC(HRESULT) tfUniverse_reset();
178
184CAPI_FUNC(HRESULT) tfUniverse_resetSpecies();
185
198CAPI_FUNC(HRESULT) tfUniverse_getTemperature(tfFloatP_t *temperature);
199
206CAPI_FUNC(HRESULT) tfUniverse_getTime(tfFloatP_t *time);
207
214CAPI_FUNC(HRESULT) tfUniverse_getDt(tfFloatP_t *dt);
215
223
230CAPI_FUNC(HRESULT) tfUniverse_getKineticEnergy(tfFloatP_t *ke);
231
238CAPI_FUNC(HRESULT) tfUniverse_getNumTypes(int *numTypes);
239
246CAPI_FUNC(HRESULT) tfUniverse_getCutoff(tfFloatP_t *cutoff);
247
248
250// tfUniverseConfigHandle //
252
253
260CAPI_FUNC(HRESULT) tfUniverseConfig_init(struct tfUniverseConfigHandle *handle);
261
268CAPI_FUNC(HRESULT) tfUniverseConfig_destroy(struct tfUniverseConfigHandle *handle);
269
277CAPI_FUNC(HRESULT) tfUniverseConfig_getDim(struct tfUniverseConfigHandle *handle, tfFloatP_t **dim);
278
286CAPI_FUNC(HRESULT) tfUniverseConfig_setDim(struct tfUniverseConfigHandle *handle, tfFloatP_t *dim);
287
295CAPI_FUNC(HRESULT) tfUniverseConfig_getCells(struct tfUniverseConfigHandle *handle, int **cells);
296
304CAPI_FUNC(HRESULT) tfUniverseConfig_setCells(struct tfUniverseConfigHandle *handle, int *cells);
305
313CAPI_FUNC(HRESULT) tfUniverseConfig_getCutoff(struct tfUniverseConfigHandle *handle, tfFloatP_t *cutoff);
314
322CAPI_FUNC(HRESULT) tfUniverseConfig_setCutoff(struct tfUniverseConfigHandle *handle, tfFloatP_t cutoff);
323
331CAPI_FUNC(HRESULT) tfUniverseConfig_getFlags(struct tfUniverseConfigHandle *handle, unsigned int *flags);
332
340CAPI_FUNC(HRESULT) tfUniverseConfig_setFlags(struct tfUniverseConfigHandle *handle, unsigned int flags);
341
349CAPI_FUNC(HRESULT) tfUniverseConfig_getDt(struct tfUniverseConfigHandle *handle, tfFloatP_t *dt);
350
358CAPI_FUNC(HRESULT) tfUniverseConfig_setDt(struct tfUniverseConfigHandle *handle, tfFloatP_t dt);
359
373CAPI_FUNC(HRESULT) tfUniverseConfig_getTemperature(struct tfUniverseConfigHandle *handle, tfFloatP_t *temperature);
374
388CAPI_FUNC(HRESULT) tfUniverseConfig_setTemperature(struct tfUniverseConfigHandle *handle, tfFloatP_t temperature);
389
397CAPI_FUNC(HRESULT) tfUniverseConfig_getNumThreads(struct tfUniverseConfigHandle *handle, unsigned int *numThreads);
398
406CAPI_FUNC(HRESULT) tfUniverseConfig_setNumThreads(struct tfUniverseConfigHandle *handle, unsigned int numThreads);
407
415CAPI_FUNC(HRESULT) tfUniverseConfig_getNumFluxSteps(struct tfUniverseConfigHandle *handle, unsigned int *numFluxSteps);
416
424CAPI_FUNC(HRESULT) tfUniverseConfig_setNumFluxSteps(struct tfUniverseConfigHandle *handle, unsigned int numFluxSteps);
425
433CAPI_FUNC(HRESULT) tfUniverseConfig_getIntegrator(struct tfUniverseConfigHandle *handle, unsigned int *integrator);
434
442CAPI_FUNC(HRESULT) tfUniverseConfig_setIntegrator(struct tfUniverseConfigHandle *handle, unsigned int integrator);
443
452
461
462#endif // _WRAPS_C_TFCUNIVERSE_H_
Handle to a BoundaryConditionsArgsContainer instance.
Definition tfCBoundaryConditions.h:80
Handle to a BoundaryConditions instance.
Definition tfCBoundaryConditions.h:72
Handle to a ParticleHandle instance.
Definition tfCParticle.h:111
Handle to a ParticleType instance.
Definition tfCParticle.h:119
Handle to a UniverseConfig instance.
Definition tfCUniverse.h:39
HRESULT tfUniverseConfig_getNumThreads(struct tfUniverseConfigHandle *handle, unsigned int *numThreads)
Get the number of threads for parallel execution.
HRESULT tfUniverseConfig_destroy(struct tfUniverseConfigHandle *handle)
Destroy an instance.
HRESULT tfUniverseConfig_setDim(struct tfUniverseConfigHandle *handle, tfFloatP_t *dim)
Set the dimensions of the universe.
HRESULT tfUniverse_getVirialO(tfFloatP_t *origin, tfFloatP_t radius, tfFloatP_t **virial)
Get the virial tensor of a neighborhood.
HRESULT tfUniverseConfig_getBoundaryConditions(struct tfUniverseConfigHandle *handle, struct tfBoundaryConditionsArgsContainerHandle *bargsHandle)
Get the boundary condition argument container.
HRESULT tfUniverse_getBoundaryConditions(struct tfBoundaryConditionsHandle *bcs)
Get the boundary conditions.
HRESULT tfUniverseConfig_setFlags(struct tfUniverseConfigHandle *handle, unsigned int flags)
Set the universe flags.
HRESULT tfUniverseConfig_setTemperature(struct tfUniverseConfigHandle *handle, tfFloatP_t temperature)
Set the universe temperature.
HRESULT tfUniverseConfig_init(struct tfUniverseConfigHandle *handle)
Initialize a new instance.
HRESULT tfUniverse_start()
Starts the universe time evolution, and advanced the universe forward by timesteps in dt....
HRESULT tfUniverseConfig_getDim(struct tfUniverseConfigHandle *handle, tfFloatP_t **dim)
Get the dimensions of the universe.
HRESULT tfUniverse_getDim(tfFloatP_t **dim)
Get the dimensions of the universe.
HRESULT tfUniverseConfig_setBoundaryConditions(struct tfUniverseConfigHandle *handle, struct tfBoundaryConditionsArgsContainerHandle *bargsHandle)
Set the boundary condition argument container.
HRESULT tfUniverse_getCutoff(tfFloatP_t *cutoff)
Get the global interaction cutoff distance.
HRESULT tfUniverseConfig_setNumThreads(struct tfUniverseConfigHandle *handle, unsigned int numThreads)
Set the number of threads for parallel execution.
HRESULT tfUniverse_getIsRunning(bool *isRunning)
Get whether the universe is running.
HRESULT tfUniverse_getNumTypes(int *numTypes)
Get the current number of registered particle types.
HRESULT tfUniverseConfig_getCells(struct tfUniverseConfigHandle *handle, int **cells)
Get the grid discretization.
HRESULT tfUniverse_reset()
Reset the universe.
HRESULT tfUniverse_getTime(tfFloatP_t *time)
Get the current time.
HRESULT tfUniverse_resetSpecies()
Reset all species in all particles.
HRESULT tfUniverse_getTemperature(tfFloatP_t *temperature)
Get the universe temperature.
HRESULT tfUniverseConfig_getCutoff(struct tfUniverseConfigHandle *handle, tfFloatP_t *cutoff)
Get the global interaction cutoff distance.
HRESULT tfUniverse_getName(char **name, unsigned int *numChars)
Get the name of the model / script.
HRESULT tfUniverse_getVirialT(struct tfParticleTypeHandle **phandles, unsigned int numTypes, tfFloatP_t **virial)
Get the virial tensor of the universe for a set of particle types.
HRESULT tfUniverse_getVirialOT(struct tfParticleTypeHandle **phandles, unsigned int numTypes, tfFloatP_t *origin, tfFloatP_t radius, tfFloatP_t **virial)
Get the virial tensor for a set of particle types in a neighborhood.
HRESULT tfUniverse_getCenter(tfFloatP_t **center)
Get the center of the universe.
HRESULT tfUniverseConfig_setCells(struct tfUniverseConfigHandle *handle, int *cells)
Set the grid discretization.
HRESULT tfUniverseConfig_setCutoff(struct tfUniverseConfigHandle *handle, tfFloatP_t cutoff)
Set the global interaction cutoff distance.
HRESULT tfUniverseConfig_getNumFluxSteps(struct tfUniverseConfigHandle *handle, unsigned int *numFluxSteps)
Get the number of flux steps per simulation step.
HRESULT tfUniverse_step(tfFloatP_t until, tfFloatP_t dt)
Integrates the universe for a duration as given by until, or for a single time step if 0 is passed.
HRESULT tfUniverse_getNumParts(unsigned int *numParts)
Get the number of particles in the universe.
HRESULT tfUniverse_getParticle(unsigned int pidx, struct tfParticleHandleHandle *handle)
Get the i'th particle of the universe.
HRESULT tfUniverse_getDt(tfFloatP_t *dt)
Get the period of a time step.
HRESULT tfUniverse_getKineticEnergy(tfFloatP_t *ke)
Get the current system kinetic energy.
HRESULT tfUniverseConfig_getTemperature(struct tfUniverseConfigHandle *handle, tfFloatP_t *temperature)
Get the universe temperature.
HRESULT tfUniverse_stop()
Stops the universe time evolution. This essentially freezes the universe, everything remains the same...
HRESULT tfUniverseConfig_getIntegrator(struct tfUniverseConfigHandle *handle, unsigned int *integrator)
Get the engine integrator enum.
HRESULT tfUniverseConfig_setIntegrator(struct tfUniverseConfigHandle *handle, unsigned int integrator)
Set the engine integrator enum.
HRESULT tfUniverseConfig_setNumFluxSteps(struct tfUniverseConfigHandle *handle, unsigned int numFluxSteps)
Set the number of flux steps per simulation step.
HRESULT tfUniverseConfig_getDt(struct tfUniverseConfigHandle *handle, tfFloatP_t *dt)
Get the period of a time step.
HRESULT tfUniverse_getVirial(tfFloatP_t **virial)
Get the virial tensor of the universe.
HRESULT tfUniverseConfig_setDt(struct tfUniverseConfigHandle *handle, tfFloatP_t dt)
Set the period of a time step.
HRESULT tfUniverseConfig_getFlags(struct tfUniverseConfigHandle *handle, unsigned int *flags)
Get the universe flags.