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

A base class for implementing force calculations. More...

#include <baseForce.h>

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

Public Member Functions

 force ()
 
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 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 scalar computeEnergy (bool verbose=false)
 compute the energy associated with this force 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...
 
virtual scalar getClassSize ()
 

Public Attributes

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...
 

Detailed Description

A base class for implementing force calculations.

Constructor & Destructor Documentation

◆ force()

force::force ( )

Member Function Documentation

◆ computeForces()

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

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

Reimplemented in landauDeGennesLC, and baseLatticeForce.

◆ setForceParameters()

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

some generic function to set parameters

◆ setSimulation()

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

set the simulation

References sim.

◆ setModel()

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

virtual function to allow the model to be a derived class

References model.

◆ computeEnergy()

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

compute the energy associated with this force

Reimplemented in baseLatticeForce.

◆ computePressureTensor()

virtual MatrixDxD force::computePressureTensor ( )
inlinevirtual

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

◆ setGPU()

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

Enforce GPU operation.

References neighbors, useGPU, and useNeighborList.

◆ setNeighborList()

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

tell the force to use a neighbor list

References neighbors, and useNeighborList.

◆ setNThreads()

virtual void force::setNThreads ( int  n)
inlinevirtual

allow for setting multiple threads

References n, and nThreads.

◆ getClassSize()

virtual scalar force::getClassSize ( )
inlinevirtual

Member Data Documentation

◆ sim

shared_ptr<basicSimulation> force::sim

A pointer to the governing simulation.

Referenced by setSimulation().

◆ model

shared_ptr<simpleModel> force::model

A pointer to a simpleModel that the updater acts on.

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

◆ useGPU

bool force::useGPU

◆ neverGPU

bool force::neverGPU

whether the updater never does work on the GPU

Referenced by landauDeGennesLC::landauDeGennesLC().

◆ energy

scalar force::energy

◆ energyPerParticle

GPUArray<scalar> force::energyPerParticle

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

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

◆ useNeighborList

bool force::useNeighborList

does the force get an assist from a neighbor list?

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

◆ neighbors

shared_ptr<neighborList> force::neighbors

◆ nThreads

int force::nThreads =1

number of threads to use if compiled with openmp

Referenced by setNThreads().


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