27#ifndef _MDCORE_INCLUDE_TFBOND_H_
28#define _MDCORE_INCLUDE_TFBOND_H_
30#include <mdcore_config.h>
42 typedef enum BondFlags {
58 typedef std::vector<Pair> PairList;
68 typedef struct CAPI_EXPORT
Bond {
77 uint64_t creation_time;
85 FPTYPE dissociation_energy;
88 FPTYPE potential_energy;
116 FPTYPE *dissociation_energy=NULL,
205 const FPTYPE &half_life=-FPTYPE_ONE,
206 const FPTYPE &bond_energy=-FPTYPE_ONE,
240 const FPTYPE &cutoff,
241 std::vector<std::pair<TissueForge::ParticleType*, TissueForge::ParticleType*>* > *ppairs,
242 const FPTYPE &half_life,
243 const FPTYPE &bond_energy,
257 static std::vector<BondHandle>
items();
269 bool has(
const int32_t &pid);
325 bool contains_bond(
const std::vector<BondHandle> &bonds,
int a,
int b);
378 std::vector<BondHandle> &bonds,
387 inline bool operator<=(
const TissueForge::BondHandle& lhs,
const TissueForge::BondHandle& rhs) {
return !(lhs > rhs); }
388 inline bool operator>=(
const TissueForge::BondHandle& lhs,
const TissueForge::BondHandle& rhs) {
return !(lhs < rhs); }
389 inline bool operator==(
const TissueForge::BondHandle& lhs,
const TissueForge::BondHandle& rhs) {
return lhs.id == rhs.id; }
390 inline bool operator!=(
const TissueForge::BondHandle& lhs,
const TissueForge::BondHandle& rhs) {
return !(lhs == rhs); }
398 os << h.
str().c_str();
Tissue Forge rendering and visualization.
Definition tfAngle.h:38
Include Python header, disable linking to pythonX_d.lib on Windows in debug mode.
Definition tfAngleConfig.h:26
HRESULT Bond_Destroy(Bond *b)
HRESULT bond_eval(Bond *b, int N, struct engine *e, FPTYPE *epot_out)
Evaluate a list of bonded interactions.
std::vector< int32_t > Bond_IdsForParticle(int32_t pid)
HRESULT Bond_DestroyAll()
Deletes all bonds in the universe.
struct TissueForge::Bond Bond
Bonds apply a potential to a particular set of particles.
HRESULT bond_evalf(Bond *b, int N, struct engine *e, FPTYPE *f, FPTYPE *epot_out)
Evaluate a list of bonded interactions.
Handle to a bond.
Definition tfBond.h:144
BondHandle(struct TissueForge::Potential *potential, int32_t i, int32_t j, FPTYPE half_life, FPTYPE bond_energy, uint32_t flags)
Construct a new bond handle and underlying bond.
void setStyle(rendering::Style *style)
ParticleList getPartList()
std::string str() const
Get a summary string of the bond.
BondHandle(int id)
Construct a new bond handle from an existing bond id.
bool has(const int32_t &pid)
std::vector< int32_t > getParts()
static std::vector< BondHandle > items()
Gets all bonds in the universe.
HRESULT destroy()
Destroy the bond.
bool has(ParticleHandle *part)
BondHandle()
Construct a new bond handle and do nothing Subsequent usage will require a call to 'init'.
Definition tfBond.h:159
HRESULT init(TissueForge::Potential *pot, TissueForge::ParticleHandle *p1, TissueForge::ParticleHandle *p2, const FPTYPE &half_life=-FPTYPE_ONE, const FPTYPE &bond_energy=-FPTYPE_ONE, uint32_t flags=0)
For initializing a bond after constructing with default constructor.
void setHalfLife(const FPTYPE &half_life)
void setDissociationEnergy(const FPTYPE &dissociation_energy)
rendering::Style * getStyle()
TissueForge::Potential * getPotential()
bool decays()
Tests whether this bond decays.
static std::vector< BondHandle > pairwise(TissueForge::Potential *pot, TissueForge::ParticleList &parts, const FPTYPE &cutoff, std::vector< std::pair< TissueForge::ParticleType *, TissueForge::ParticleType * > * > *ppairs, const FPTYPE &half_life, const FPTYPE &bond_energy, uint32_t flags)
Apply bonds to a list of particles.
TissueForge::Bond * get()
Gets the underlying bond.
bool check()
Check the validity of the handle.
FPTYPE getDissociationEnergy()
Bonds apply a potential to a particular set of particles.
Definition tfBond.h:68
FPTYPE half_life
Definition tfBond.h:82
static Bond * fromString(const std::string &str)
Create from a JSON string representation.
static rendering::Style * styleDef()
Get the default style.
std::string toString()
Get a JSON string representation.
static BondHandle * create(struct Potential *potential, ParticleHandle *i, ParticleHandle *j, FPTYPE *half_life=NULL, FPTYPE *dissociation_energy=NULL, uint32_t flags=0)
Construct a new bond handle and underlying bond.
A handle to a particle.
Definition tfParticle.h:313
A special list with convenience methods for working with sets of particles.
Definition tfParticleList.h:52
A Potential object is a compiled interpolation of a given function. The Universe applies potentials t...
Definition tfPotential.h:213
Definition tfEngine.h:164
The Tissue Forge style type.
Definition tfStyle.h:46
int32_t HRESULT
Definition tf_port.h:255