Open Qmin  0.8.0
GPU-accelerated Q-tensor-based liquid crystal simulations
Public Member Functions | Public Attributes | Protected Attributes | List of all members
baseLatticeForce Class Reference

A lattice-based force specialized to lattices (which support getNiehgbor function) More...

#include <baseLatticeForce.h>

Inheritance diagram for baseLatticeForce:
Inheritance graph
[legend]
Collaboration diagram for baseLatticeForce:
Collaboration graph
[legend]

Public Member Functions

 baseLatticeForce ()
 
virtual void computeForces (GPUArray< dVec > &forces, bool zeroOutForce=true, int type=0)
 the call to compute forces, and store them in the referenced variable More...
 
virtual void computeForceGPU (GPUArray< dVec > &forces, bool zeroOutForce=true)
 As an example of usage, we'll implement an n-Vector model force w/ nearest-neighbor interactions. More...
 
virtual void computeForceCPU (GPUArray< dVec > &forces, bool zeroOutForce=true)
 As an example of usage, we'll implement an n-Vector model force w/ nearest-neighbor interactions. More...
 
void setJ (scalar _j)
 
virtual scalar computeEnergy (bool verbose=false)
 compute the energy associated with this force More...
 
virtual void computeEnergyCPU (bool verbose=false)
 As an example of usage, we'll implement an n-Vector model force w/ nearest-neighbor interactions. More...
 
virtual void computeEnergyGPU (bool verbose=false)
 
virtual void setModel (shared_ptr< cubicLattice > _model)
 virtual function to allow the model to be a derived class More...
 
virtual scalar getClassSize ()
 
virtual void setForceParameters (vector< scalar > &params)
 some generic function to set parameters More...
 
void setSimulation (shared_ptr< basicSimulation > _sim)
 set the simulation More...
 
virtual void setModel (shared_ptr< simpleModel > _model)
 virtual function to allow the model to be a derived class More...
 
virtual MatrixDxD computePressureTensor ()
 compute the system-averaged pressure tensor; return identity if the force hasn't defined this yet More...
 
virtual void setGPU (bool _useGPU=true)
 Enforce GPU operation. More...
 
void setNeighborList (shared_ptr< neighborList > _neighbor)
 tell the force to use a neighbor list More...
 
virtual void setNThreads (int n)
 allow for setting multiple threads More...
 

Public Attributes

shared_ptr< kernelTunerforceTuner
 kernelTuner object More...
 
shared_ptr< basicSimulationsim
 A pointer to the governing simulation. More...
 
shared_ptr< simpleModelmodel
 A pointer to a simpleModel that the updater acts on. More...
 
bool useGPU
 whether the updater does its work on the GPU or not More...
 
bool neverGPU
 whether the updater never does work on the GPU More...
 
scalar energy
 Forces might update the total energy associated with them. More...
 
GPUArray< scalarenergyPerParticle
 on the gpu, this is per particle and then a reduction can be called More...
 
bool useNeighborList
 does the force get an assist from a neighbor list? More...
 
shared_ptr< neighborListneighbors
 a pointer to a neighbor list the force might use More...
 
int nThreads =1
 number of threads to use if compiled with openmp More...
 

Protected Attributes

shared_ptr< cubicLatticelattice
 
scalar J
 if all lattice interactions are uniform More...
 

Detailed Description

A lattice-based force specialized to lattices (which support getNiehgbor function)

Constructor & Destructor Documentation

◆ baseLatticeForce()

baseLatticeForce::baseLatticeForce ( )

References forceTuner, J, and force::useNeighborList.

Member Function Documentation

◆ computeForces()

virtual void baseLatticeForce::computeForces ( GPUArray< dVec > &  forces,
bool  zeroOutForce = true,
int  type = 0 
)
inlinevirtual

the call to compute forces, and store them in the referenced variable

Reimplemented from force.

Reimplemented in landauDeGennesLC.

References computeForceCPU(), computeForceGPU(), and force::useGPU.

◆ computeForceGPU()

void baseLatticeForce::computeForceGPU ( GPUArray< dVec > &  forces,
bool  zeroOutForce = true 
)
virtual

As an example of usage, we'll implement an n-Vector model force w/ nearest-neighbor interactions.

Reimplemented in landauDeGennesLC.

References ArrayHandle< T >::data, access_location::device, forceTuner, gpu_lattice_spin_force_nn(), J, lattice, access_mode::read, and access_mode::readwrite.

Referenced by computeForces().

◆ computeForceCPU()

void baseLatticeForce::computeForceCPU ( GPUArray< dVec > &  forces,
bool  zeroOutForce = true 
)
virtual

As an example of usage, we'll implement an n-Vector model force w/ nearest-neighbor interactions.

References ArrayHandle< T >::data, J, lattice, make_dVec(), and force::neighbors.

Referenced by computeForces().

◆ setJ()

void baseLatticeForce::setJ ( scalar  _j)
inline

References J.

◆ computeEnergy()

virtual scalar baseLatticeForce::computeEnergy ( bool  verbose = false)
inlinevirtual

compute the energy associated with this force

Reimplemented from force.

References computeEnergyCPU(), computeEnergyGPU(), force::energy, and force::useGPU.

◆ computeEnergyCPU()

void baseLatticeForce::computeEnergyCPU ( bool  verbose = false)
virtual

As an example of usage, we'll implement an n-Vector model force w/ nearest-neighbor interactions.

Reimplemented in landauDeGennesLC.

References dot(), force::energy, J, lattice, and force::neighbors.

Referenced by computeEnergy().

◆ computeEnergyGPU()

virtual void baseLatticeForce::computeEnergyGPU ( bool  verbose = false)
inlinevirtual

Reimplemented in landauDeGennesLC.

References force::energy.

Referenced by computeEnergy().

◆ setModel() [1/2]

virtual void baseLatticeForce::setModel ( shared_ptr< cubicLattice _model)
inlinevirtual

virtual function to allow the model to be a derived class

Reimplemented in landauDeGennesLC.

References lattice, and force::model.

◆ getClassSize()

virtual scalar baseLatticeForce::getClassSize ( )
inlinevirtual

Reimplemented from force.

Reimplemented in landauDeGennesLC.

References force::getClassSize(), and scalar.

Referenced by landauDeGennesLC::getClassSize().

◆ setForceParameters()

void force::setForceParameters ( vector< scalar > &  params)
virtualinherited

some generic function to set parameters

◆ setSimulation()

void force::setSimulation ( shared_ptr< basicSimulation _sim)
inlineinherited

set the simulation

References force::sim.

◆ setModel() [2/2]

virtual void force::setModel ( shared_ptr< simpleModel _model)
inlinevirtualinherited

virtual function to allow the model to be a derived class

References force::model.

◆ computePressureTensor()

virtual MatrixDxD force::computePressureTensor ( )
inlinevirtualinherited

compute the system-averaged pressure tensor; return identity if the force hasn't defined this yet

◆ setGPU()

virtual void force::setGPU ( bool  _useGPU = true)
inlinevirtualinherited

Enforce GPU operation.

References force::neighbors, force::useGPU, and force::useNeighborList.

◆ setNeighborList()

void force::setNeighborList ( shared_ptr< neighborList _neighbor)
inlineinherited

tell the force to use a neighbor list

References force::neighbors, and force::useNeighborList.

◆ setNThreads()

virtual void force::setNThreads ( int  n)
inlinevirtualinherited

allow for setting multiple threads

References n, and force::nThreads.

Member Data Documentation

◆ forceTuner

shared_ptr<kernelTuner> baseLatticeForce::forceTuner

◆ lattice

shared_ptr<cubicLattice> baseLatticeForce::lattice
protected

◆ J

scalar baseLatticeForce::J
protected

if all lattice interactions are uniform

Referenced by baseLatticeForce(), computeEnergyCPU(), computeForceCPU(), computeForceGPU(), and setJ().

◆ sim

shared_ptr<basicSimulation> force::sim
inherited

A pointer to the governing simulation.

Referenced by force::setSimulation().

◆ model

shared_ptr<simpleModel> force::model
inherited

A pointer to a simpleModel that the updater acts on.

Referenced by landauDeGennesLC::setModel(), force::setModel(), and setModel().

◆ useGPU

bool force::useGPU
inherited

◆ neverGPU

bool force::neverGPU
inherited

whether the updater never does work on the GPU

Referenced by landauDeGennesLC::landauDeGennesLC().

◆ energy

scalar force::energy
inherited

Forces might update the total energy associated with them.

Referenced by computeEnergy(), computeEnergyCPU(), landauDeGennesLC::computeEnergyCPU(), computeEnergyGPU(), and landauDeGennesLC::computeEnergyGPU().

◆ energyPerParticle

GPUArray<scalar> force::energyPerParticle
inherited

on the gpu, this is per particle and then a reduction can be called

Referenced by force::getClassSize(), and landauDeGennesLC::landauDeGennesLC().

◆ useNeighborList

bool force::useNeighborList
inherited

does the force get an assist from a neighbor list?

Referenced by landauDeGennesLC::baseInitialization(), baseLatticeForce(), force::force(), force::setGPU(), and force::setNeighborList().

◆ neighbors

shared_ptr<neighborList> force::neighbors
inherited

◆ nThreads

int force::nThreads =1
inherited

number of threads to use if compiled with openmp

Referenced by force::setNThreads().


The documentation for this class was generated from the following files: