|
| enum | Selection {
ALL,
ACTIVE,
INACTIVE,
ALL_NEUTRAL,
ACTIVE_NEUTRAL,
INACTIVE_NEUTRAL
} |
| |
|
using | GeometryType = Geometry::Chameleon |
| |
|
using | GroupType = Group |
| | Continuous range of particles defining molecules.
|
| |
|
using | GroupVector = std::vector< GroupType > |
| |
|
using | GroupRefVector = std::vector< std::reference_wrapper< Group > > |
| |
|
using | ConstGroupRefVector = std::vector< std::reference_wrapper< const Group > > |
| |
|
using | ScaleVolumeTrigger = std::function< void(Space &, double, double)> |
| |
|
using | ChangeTrigger = std::function< void(Space &, const Change &)> |
| |
|
using | SyncTrigger = std::function< void(Space &, const Space &, const Change &)> |
| |
|
|
const std::map< MoleculeData::index_type, std::size_t > & | getImplicitReservoir () const |
| | Implicit molecules.
|
| |
| std::map< MoleculeData::index_type, std::size_t > & | getImplicitReservoir () |
| | Implicit molecules. More...
|
| |
|
void | clear () |
| | Clears particle and molecule list.
|
| |
| GroupType & | addGroup (MoleculeData::index_type molid, const ParticleVector &particles) |
| | Append a group. More...
|
| |
|
GroupVector::iterator | findGroupContaining (const Particle &particle, bool include_inactive=false) |
| | Finds the group containing the given atom.
|
| |
|
GroupVector::iterator | findGroupContaining (AtomData::index_type atom_index) |
| | Find group containing atom index.
|
| |
|
size_t | numParticles (Selection selection=Selection::ACTIVE) const |
| | Number of (active) particles.
|
| |
| Point | scaleVolume (double new_volume, Geometry::VolumeMethod method=Geometry::VolumeMethod::ISOTROPIC) |
| | Scales atoms, molecules, container. More...
|
| |
|
GroupVector::iterator | randomMolecule (MoleculeData::index_type molid, Random &rand, Selection selection=Selection::ACTIVE) |
| | Random group matching molid.
|
| |
|
json | info () |
| |
| std::size_t | getGroupIndex (const GroupType &group) const |
| | Get index of given group in the group vector. More...
|
| |
|
std::size_t | getFirstParticleIndex (const GroupType &group) const |
| | Index of first particle in group.
|
| |
| std::size_t | getFirstActiveParticleIndex (const GroupType &group) const |
| | Index of first particle w. respect to active particles. More...
|
| |
| template<std::forward_iterator iterator, class copy_operation = std::function<void(const Particle&, Particle&)>> |
| void | updateParticles (const iterator begin, const iterator end, ParticleVector::iterator destination, copy_operation copy_function=[](const Particle &src, Particle &dst) { dst=src;}) |
| | Update particles in Space from a source range. More...
|
| |
| void | updateInternalState (const Change &change) |
| | This will make sure that the internal state is updated to reflect a change. More...
|
| |
|
auto | positions () const |
| | Iterable range of all particle positions.
|
| |
|
auto | positions () |
| | Mutable iterable range of all particle positions.
|
| |
| auto | findMolecules (MoleculeData::index_type molid, Selection selection=Selection::ACTIVE) |
| | Finds all groups of type molid (complexity: order N) More...
|
| |
|
auto | findMolecules (MoleculeData::index_type molid, Selection selection=Selection::ACTIVE) const |
| |
|
auto | activeParticles () |
| | Range with all active particles.
|
| |
|
auto | activeParticles () const |
| | Range with all active particles.
|
| |
| template<std::integral index_type = int> |
| auto | toIndices (const RequireParticles auto &particle_range) const |
| | Get vector of indices of given range of particles. More...
|
| |
| auto | findAtoms (AtomData::index_type atomid) |
| | Find active atoms of type atomid (complexity: order N) More...
|
| |
| auto | findAtoms (AtomData::index_type atomid) const |
| | Find active atoms of type atomid (complexity: order N) More...
|
| |
|
size_t | countAtoms (AtomData::index_type atomid) const |
| | Count active particles.
|
| |
| template<unsigned int mask> |
| auto | numMolecules (MoleculeData::index_type molid) const |
| | Count number of molecules matching criteria. More...
|
| |
| void | sync (const Space &other, const Change &change) |
| | Copy differing data from other Space using Change object. More...
|
| |
Placeholder for atoms and molecules.
Space is pervasive in the code as it stores the state of
- particles
- groups
- simulation container (
geometry)
- implicit particles and groups
It has methods to insert, find, and probe particles, groups, as well as scaling the volume of the system
template<std::forward_iterator iterator, class copy_operation = std::function<void(const Particle&, Particle&)>>
| void Faunus::Space::updateParticles |
( |
const iterator |
begin, |
|
|
const iterator |
end, |
|
|
ParticleVector::iterator |
destination, |
|
|
copy_operation |
copy_function = [](const Particle& src, Particle& dst) { dst = src; } |
|
) |
| |
|
inline |
Update particles in Space from a source range.
- Template Parameters
-
| iterator | Iterator for source range |
| copy_operation | Functor used to copy data from an element in the source range to element in Space:p |
- Parameters
-
| begin | Begin of source particle range |
| end | End of source particle range |
| destination | Iterator to target particle vector (should be in Space::p) |
| copy_function | Function used to copy from source range to destination particle |
By default a source range of particles is expected and all content is copied. This can be customised to e.g. a position range by giving a copy_function such as [](const auto &pos, auto &particle){particle.pos = pos;}.
The following is updated:
- particles
- molecular mass centers of affected groups
- future: update cell list?
- Todo:
- Since Space::groups is ordered, binary search could be used to filter