25#ifndef _MDCORE_INCLUDE_TFBOUNDARYCONDITIONS_H_
26#define _MDCORE_INCLUDE_TFBOUNDARYCONDITIONS_H_
28#include <mdcore_config.h>
32#include <unordered_map>
38 enum BoundaryConditionKind :
unsigned int {
39 BOUNDARY_VELOCITY = 1 << 0,
40 BOUNDARY_PERIODIC = 1 << 1,
41 BOUNDARY_FREESLIP = 1 << 2,
42 BOUNDARY_POTENTIAL = 1 << 3,
43 BOUNDARY_NO_SLIP = 1 << 4,
44 BOUNDARY_RESETTING = 1 << 5,
45 BOUNDARY_ACTIVE = BOUNDARY_FREESLIP | BOUNDARY_VELOCITY | BOUNDARY_POTENTIAL
56 BoundaryConditionKind kind;
100 std::string kindStr()
const;
101 std::string str(
bool show_name)
const;
103 unsigned init(
const unsigned &kind);
104 unsigned init(
const FVector3 &velocity,
const FPTYPE *restore=NULL);
106 const std::unordered_map<std::string, unsigned int> vals,
107 const std::unordered_map<std::string, FVector3> vels,
108 const std::unordered_map<std::string, FPTYPE> restores
170 const std::unordered_map<std::string, unsigned int> vals,
171 const std::unordered_map<std::string, FVector3> vels,
172 const std::unordered_map<std::string, FPTYPE> restores
188 static unsigned boundaryKindFromString(
const std::string &s);
189 static unsigned boundaryKindFromStrings(
const std::vector<std::string> &kinds);
214 void _initDirections(
const std::unordered_map<std::string, unsigned int> vals);
218 const std::unordered_map<std::string, unsigned int> vals,
219 const std::unordered_map<std::string, FVector3> vels,
220 const std::unordered_map<std::string, FPTYPE> restores
226 std::unordered_map<std::string, unsigned int> *bcVals;
227 std::unordered_map<std::string, FVector3> *bcVels;
228 std::unordered_map<std::string, FPTYPE> *bcRestores;
230 void setValueAll(
const int &_bcValue);
231 void setValue(
const std::string &name,
const unsigned int &value);
232 void setVelocity(
const std::string &name,
const FVector3 &velocity);
233 void setRestore(
const std::string &name,
const FPTYPE restore);
239 std::unordered_map<std::string, unsigned int> *_bcVals=NULL,
240 std::unordered_map<std::string, FVector3> *_bcVels=NULL,
241 std::unordered_map<std::string, FPTYPE> *_bcRestores=NULL
245 void switchType(
const bool &allSides);
Include Python header, disable linking to pythonX_d.lib on Windows in debug mode.
Definition tfAngleConfig.h:26
void apply_boundary_particle_crossing(struct Particle *p, const int *delta, const struct space_cell *source_cell, const struct space_cell *dest_cell)
A condition on a boundary of the universe.
Definition tfBoundaryConditions.h:55
FPTYPE restore
restoring percent.
Definition tfBoundaryConditions.h:73
void set_potential(struct ParticleType *ptype, struct Potential *pot)
FVector3 normal
vector normal to the boundary
Definition tfBoundaryConditions.h:83
const char * name
name of the boundary
Definition tfBoundaryConditions.h:78
FVector3 velocity
the velocity on the boundary
Definition tfBoundaryConditions.h:64
struct Potential ** potenntials
Definition tfBoundaryConditions.h:88
Definition tfBoundaryConditions.h:224
The BoundaryConditions class serves as a container for the six instances of the :class:BoundaryCondit...
Definition tfBoundaryConditions.h:117
BoundaryCondition front
The front boundary.
Definition tfBoundaryConditions.h:142
static FVector3 boundedPosition(const FVector3 &position)
Enforce boundary conditions on a position.
std::string toString()
Get a JSON string representation.
static BoundaryConditions * fromString(const std::string &str)
Create from a JSON string representation.
BoundaryCondition top
The top boundary.
Definition tfBoundaryConditions.h:122
uint32_t periodic
Definition tfBoundaryConditions.h:186
static void boundedPosition(FVector3 &position)
Enforce boundary conditions on a position.
void set_potential(struct ParticleType *ptype, struct Potential *pot)
sets a potential for ALL boundary conditions and the given potential.
BoundaryCondition bottom
The bottom boundary.
Definition tfBoundaryConditions.h:127
BoundaryCondition back
The back boundary.
Definition tfBoundaryConditions.h:147
BoundaryCondition right
The right boundary.
Definition tfBoundaryConditions.h:137
BoundaryCondition left
The left boundary.
Definition tfBoundaryConditions.h:132
Definition tfParticle.h:101
Structure containing information on each particle type.
Definition tfParticle.h:768
A Potential object is a compiled interpolation of a given function. The Universe applies potentials t...
Definition tfPotential.h:213
the space_cell structure
Definition tfSpace_cell.h:103
int32_t HRESULT
Definition tf_port.h:255