Open Qmin
0.8.0
GPU-accelerated Q-tensor-based liquid crystal simulations
|
A base interfacing class that defines common operations. More...
#include <simpleModel.h>
Public Member Functions | |
simpleModel (int n, bool _useGPU=false, bool _neverGPU=false) | |
The base constructor requires the number of particles. More... | |
simpleModel () | |
a blank default constructor More... | |
void | initializeSimpleModel (int n) |
initialize the size of the basic data structure arrays More... | |
virtual void | setGPU (bool _useGPU=true) |
Enforce GPU operation. More... | |
virtual int | getNumberOfParticles () |
get the number of degrees of freedom, defaulting to the number of cells More... | |
virtual void | moveParticles (GPUArray< dVec > &displacements, scalar scale=1.) |
move the degrees of freedom More... | |
virtual void | computeForces (bool zeroOutForces=false) |
do everything unusual to compute additional forces... by default, sets forces to zero More... | |
void | setParticlePositions (GPUArray< dVec > &newPositions) |
void | setParticlePositions (vector< dVec > &newPositions) |
void | setParticlePositionsRandomly (noiseSource &noise) |
scalar | setVelocitiesMaxwellBoltzmann (scalar T, noiseSource &noise) |
Set velocities via a temperature. The return value is the total kinetic energy. More... | |
virtual scalar | computeKineticEnergy (bool verbose=false) |
compute the current KE More... | |
virtual scalar | computeInstantaneousTemperature (bool fixedMomentum=true) |
compute the dimension-dependent instantaneous temperature More... | |
virtual void | spatialSorting () |
do everything necessary to perform a Hilbert sort More... | |
virtual GPUArray< dVec > & | returnPositions () |
return a reference to the GPUArray of positions More... | |
virtual GPUArray< dVec > & | returnForces () |
return a reference to the GPUArray of the current forces More... | |
virtual GPUArray< int > & | returnTypes () |
return a reference to the GPUArray of the integer types More... | |
virtual GPUArray< dVec > & | returnVelocities () |
return a reference to the GPUArray of the current velocities More... | |
virtual GPUArray< scalar > & | returnDefectMeasures () |
return a reference to the GPUArray of the current defects More... | |
virtual void | setNThreads (int n) |
allow for setting multiple threads More... | |
virtual void | displaceBoundaryObject (int objectIndex, int motionDirection, int magnitude) |
virtual void | freeGPUArrays (bool freeVelocities, bool freeRadii, bool freeMasses) |
some situations do not require us to maintain various data structures More... | |
virtual scalar | getClassSize () |
return size of data in class in GB More... | |
Public Attributes | |
bool | selfForceCompute |
Does this model have a special force it needs to compute itself? More... | |
BoxPtr | Box |
The space in which the particles live. More... | |
bool | forcesComputed |
Are the forces current? set to false after every call to moveParticles. set to true after the SIMULATION calls computeForces. More... | |
GPUArray< scalar > | defectMeasures |
scalars that can represent different defect measures More... | |
bool | neverGPU |
Whereas useGPU can be turned on and off, neverGPU is fixed. More... | |
Protected Attributes | |
int | N |
The number of particles. More... | |
int | nThreads =1 |
number of threads to use More... | |
GPUArray< dVec > | positions |
particle positions More... | |
GPUArray< dVec > | velocities |
particle velocities More... | |
GPUArray< dVec > | forces |
Forces on particles. More... | |
GPUArray< int > | types |
particle types More... | |
bool | useGPU |
particle radii More... | |
A base interfacing class that defines common operations.
This provides an interface, guaranteeing that SimpleModel S will provide access to S.setGPU(); S.getNumberOfParticles(); S.computeForces(); S.moveParticles(); S.returnForces(); S.returnPositions(); S.returnVelocities(); S.returnRadii(); S.returnMasses(); S.returnTypes(); S.spatialSorting(); S.returnAdditionalData();
simpleModel::simpleModel | ( | int | n, |
bool | _useGPU = false , |
||
bool | _neverGPU = false |
||
) |
The base constructor requires the number of particles.
Set the size of basic data structures...
References Box, initializeSimpleModel(), n, and N.
|
inline |
a blank default constructor
void simpleModel::initializeSimpleModel | ( | int | n | ) |
initialize the size of the basic data structure arrays
actually set the array sizes. positions, velocities, forces are zero masses are set to unity
References defectMeasures, forces, make_dVec(), n, N, neverGPU, GPUArray< T >::noGPU, positions, GPUArray< T >::resize(), selfForceCompute, types, and velocities.
Referenced by cubicLattice::initializeNSites(), setParticlePositions(), and simpleModel().
|
inlinevirtual |
Enforce GPU operation.
References useGPU.
|
inlinevirtual |
get the number of degrees of freedom, defaulting to the number of cells
References N.
move the degrees of freedom
move particles on either CPU or gpu
Reimplemented in qTensorLatticeModel, and cubicLattice.
References Box, ArrayHandle< T >::data, access_location::device, forcesComputed, gpu_move_particles(), access_location::host, N, positions, access_mode::read, access_mode::readwrite, and useGPU.
|
virtual |
do everything unusual to compute additional forces... by default, sets forces to zero
References ArrayHandle< T >::data, forces, gpu_set_array(), N, and useGPU.
void simpleModel::setParticlePositions | ( | GPUArray< dVec > & | newPositions | ) |
References Box, ArrayHandle< T >::data, GPUArray< T >::getNumElements(), initializeSimpleModel(), N, and positions.
void simpleModel::setParticlePositions | ( | vector< dVec > & | newPositions | ) |
References Box, ArrayHandle< T >::data, initializeSimpleModel(), N, and positions.
void simpleModel::setParticlePositionsRandomly | ( | noiseSource & | noise | ) |
References Box, ArrayHandle< T >::data, noiseSource::getRealUniform(), N, and positions.
scalar simpleModel::setVelocitiesMaxwellBoltzmann | ( | scalar | T, |
noiseSource & | noise | ||
) |
Set velocities via a temperature. The return value is the total kinetic energy.
References ArrayHandle< T >::data, dot(), noiseSource::getRealNormal(), N, scalar, and velocities.
|
virtual |
compute the current KE
References ArrayHandle< T >::data, dot(), N, scalar, and velocities.
|
virtual |
compute the dimension-dependent instantaneous temperature
References ArrayHandle< T >::data, dot(), N, scalar, and velocities.
|
inlinevirtual |
do everything necessary to perform a Hilbert sort
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
return a reference to the GPUArray of the current velocities
References velocities.
return a reference to the GPUArray of the current defects
|
inlinevirtual |
|
inlinevirtual |
Reimplemented in cubicLattice.
|
inlinevirtual |
some situations do not require us to maintain various data structures
|
inlinevirtual |
return size of data in class in GB
Reimplemented in cubicLattice, qTensorLatticeModel, and multirankQTensorLatticeModel.
References defectMeasures, forces, GPUArray< T >::getNumElements(), positions, scalar, types, and velocities.
Referenced by cubicLattice::getClassSize().
bool simpleModel::selfForceCompute |
Does this model have a special force it needs to compute itself?
Referenced by cubicLattice::cubicLattice(), and initializeSimpleModel().
BoxPtr simpleModel::Box |
The space in which the particles live.
Referenced by cubicLattice::cubicLattice(), moveParticles(), setParticlePositions(), setParticlePositionsRandomly(), and simpleModel().
bool simpleModel::forcesComputed |
Are the forces current? set to false after every call to moveParticles. set to true after the SIMULATION calls computeForces.
Referenced by moveParticles().
scalars that can represent different defect measures
Referenced by qTensorLatticeModel::computeDefectMeasures(), getClassSize(), initializeSimpleModel(), and qTensorLatticeModel::qTensorLatticeModel().
bool simpleModel::neverGPU |
Whereas useGPU can be turned on and off, neverGPU is fixed.
Referenced by cubicLattice::createBoundaryObject(), cubicLattice::cubicLattice(), cubicLattice::initializeNSites(), initializeSimpleModel(), multirankQTensorLatticeModel::multirankQTensorLatticeModel(), and qTensorLatticeModel::qTensorLatticeModel().
|
protected |
The number of particles.
Referenced by cubicLattice::averagePosition(), qTensorLatticeModel::computeDefectMeasures(), computeForces(), computeInstantaneousTemperature(), computeKineticEnergy(), cubicLattice::cubicLattice(), cubicLattice::fillNeighborLists(), qTensorLatticeModel::getAverageEigenvalues(), getNumberOfParticles(), multirankQTensorLatticeModel::indexToPosition(), cubicLattice::initializeNSites(), initializeSimpleModel(), cubicLattice::moveParticles(), qTensorLatticeModel::moveParticles(), moveParticles(), multirankQTensorLatticeModel::multirankQTensorLatticeModel(), multirankQTensorLatticeModel::positionToIndex(), qTensorLatticeModel::qTensorLatticeModel(), multirankQTensorLatticeModel::readReceivingBuffer(), qTensorLatticeModel::setNematicQTensorRandomly(), setParticlePositions(), setParticlePositionsRandomly(), cubicLattice::setSpinsRandomly(), setVelocitiesMaxwellBoltzmann(), and simpleModel().
|
protected |
number of threads to use
Referenced by setNThreads().
|
protected |
particle positions
Referenced by cubicLattice::averagePosition(), qTensorLatticeModel::computeDefectMeasures(), qTensorLatticeModel::createBoundaryFromFile(), qTensorLatticeModel::createSimpleFlatWallNormal(), qTensorLatticeModel::createSimpleFlatWallZNormal(), qTensorLatticeModel::createSimpleSpherialColloid(), cubicLattice::displaceBoundaryObject(), qTensorLatticeModel::getAverageEigenvalues(), getClassSize(), initializeSimpleModel(), cubicLattice::moveParticles(), qTensorLatticeModel::moveParticles(), moveParticles(), multirankQTensorLatticeModel::multirankQTensorLatticeModel(), multirankQTensorLatticeModel::prepareSendingBuffer(), multirankQTensorLatticeModel::readReceivingBuffer(), returnPositions(), qTensorLatticeModel::setNematicQTensorRandomly(), setParticlePositions(), setParticlePositionsRandomly(), and cubicLattice::setSpinsRandomly().
|
protected |
particle velocities
Referenced by computeInstantaneousTemperature(), computeKineticEnergy(), getClassSize(), initializeSimpleModel(), multirankQTensorLatticeModel::multirankQTensorLatticeModel(), returnVelocities(), and setVelocitiesMaxwellBoltzmann().
|
protected |
Forces on particles.
Referenced by computeForces(), getClassSize(), initializeSimpleModel(), multirankQTensorLatticeModel::multirankQTensorLatticeModel(), and returnForces().
|
protected |
particle types
Referenced by cubicLattice::averagePosition(), qTensorLatticeModel::computeDefectMeasures(), cubicLattice::createBoundaryObject(), cubicLattice::displaceBoundaryObject(), qTensorLatticeModel::getAverageEigenvalues(), getClassSize(), initializeSimpleModel(), multirankQTensorLatticeModel::multirankQTensorLatticeModel(), multirankQTensorLatticeModel::prepareSendingBuffer(), multirankQTensorLatticeModel::readReceivingBuffer(), returnTypes(), and qTensorLatticeModel::setNematicQTensorRandomly().
|
protected |
particle radii
particle masses Whether the GPU should be used to compute anything
Referenced by qTensorLatticeModel::computeDefectMeasures(), computeForces(), cubicLattice::cubicLattice(), cubicLattice::displaceBoundaryObject(), cubicLattice::moveParticles(), qTensorLatticeModel::moveParticles(), moveParticles(), multirankQTensorLatticeModel::prepareSendingBuffer(), multirankQTensorLatticeModel::readReceivingBuffer(), setGPU(), qTensorLatticeModel::setNematicQTensorRandomly(), and cubicLattice::setSpinsRandomly().