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

A landau-de gennes q-tensor framework force computer...currently working with the one-constant approximation for the distortion term. More...

#include <landauDeGennesLC.h>

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

Public Member Functions

 landauDeGennesLC (bool _neverGPU=false)
 
 landauDeGennesLC (scalar _A, scalar _B, scalar _C, scalar _L1)
 
 landauDeGennesLC (scalar _A, scalar _B, scalar _C, scalar _L1, scalar _L2, scalar _L3, scalar _L4, scalar _L6)
 
 landauDeGennesLC (scalar _A, scalar _B, scalar _C, scalar _L1, scalar _L2, scalar _L3orWavenumber, distortionEnergyType _type)
 
void baseInitialization ()
 set up a few basic things (common force tuners, number of energy components, etc.) More...
 
virtual void setModel (shared_ptr< cubicLattice > _model)
 The model setting creates an additional data structure to help with 2- or 3- constant approximation. More...
 
virtual void computeForces (GPUArray< dVec > &forces, bool zeroOutForce=true, int type=0)
 use the "type" flag to select either bulk or boundary routines 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...
 
void setPhaseConstants (scalar _a=-1, scalar _b=-12.325581395, scalar _c=10.058139535)
 
void setElasticConstants (scalar _l1=2.32, scalar _l2=0, scalar _l3=0, scalar _l4=0, scalar _l6=0)
 
void setNumberOfConstants (distortionEnergyType _type)
 
virtual void computeForceCPU (GPUArray< dVec > &forces, bool zeroOutForce=true, int type=0)
 
virtual void computeObjectForces (int objectIdx)
 compute the forces on the objects in the system More...
 
virtual void computeFirstDerivatives ()
 Precompute the first derivatives at all of the LC Sites. More...
 
virtual void computeStressTensors (GPUArray< int > &sites, GPUArray< Matrix3x3 > &stress)
 compute the stress tensors at the given set of sites More...
 
virtual void computeBoundaryForcesCPU (GPUArray< dVec > &forces, bool zeroOutForce)
 
virtual void computeBoundaryForcesGPU (GPUArray< dVec > &forces, bool zeroOutForce)
 
virtual void computeEorHFieldForcesCPU (GPUArray< dVec > &forces, bool zeroOutForce, scalar3 field, scalar anisotropicSusceptibility, scalar vacuumPermeability)
 
virtual void computeEorHFieldForcesGPU (GPUArray< dVec > &forces, bool zeroOutForce, scalar3 field, scalar anisotropicSusceptibility, scalar vacuumPermeability)
 
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)
 
void printTuners ()
 
void setEField (scalar3 field, scalar eps, scalar eps0, scalar deltaEps)
 
void setHField (scalar3 field, scalar chi, scalar _mu0, scalar _deltaChi)
 
virtual scalar getClassSize ()
 
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 setModel (shared_ptr< simpleModel > _model)
 virtual function to allow the model to be a derived class 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 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

vector< scalarenergyComponents
 A vector storing the components of energy (phase,distortion,anchoring) More...
 
GPUArray< scalarenergyDensity
 the free energy density at each lattice site More...
 
GPUArray< scalarenergyDensityReduction
 A helper array for energy reductions. More...
 
GPUArray< scalar3objectForceArray
 the force from stresses at the surface of an object More...
 
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 Member Functions

virtual void computeL1BulkCPU (GPUArray< dVec > &forces, bool zeroOutForce)
 Compute L1 distortion terms in the bulk and the phase force. More...
 
virtual void computeL1BoundaryCPU (GPUArray< dVec > &forces, bool zeroOutForce)
 Compute L1 distortion terms at boundaries and the phase force. More...
 
virtual void computeAllDistortionTermsBulkCPU (GPUArray< dVec > &forces, bool zeroOutForce)
 Compute all distortion terms in the bulk and the phase force. More...
 
virtual void computeAllDistortionTermsBoundaryCPU (GPUArray< dVec > &forces, bool zeroOutForce)
 Compute all distortion terms at boundaries and the phase force. More...
 

Protected Attributes

scalar A
 constants, etc. More...
 
scalar B
 
scalar C
 
scalar L1
 
scalar L2
 
scalar L3
 
scalar L4
 
scalar L6
 
scalar q0
 
scalar3 Efield
 
scalar deltaEpsilon
 
scalar epsilon0
 
scalar epsilon
 
scalar3 Hfield
 
scalar deltaChi
 
scalar Chi
 
scalar mu0
 
distortionEnergyType numberOfConstants
 number of elastic constants More...
 
bool computeEfieldContribution
 switches for extra parts of the energy/force calculations More...
 
bool computeHfieldContribution
 
GPUArray< cubicLatticeDerivativeVectorforceCalculationAssist
 for 2- and 3- constant approximations, the force calculation is helped by first pre-computing first derivatives More...
 
shared_ptr< kernelTunerforceAssistTuner
 performance for the first derivative calculation More...
 
shared_ptr< kernelTunerboundaryForceTuner
 performance for the boundary force kernel More...
 
shared_ptr< kernelTunerl24ForceTuner
 performance for the l24 force kernel More...
 
shared_ptr< kernelTunerfieldForceTuner
 performance for the E/H field force kernel More...
 
shared_ptr< cubicLatticelattice
 
scalar J
 if all lattice interactions are uniform More...
 

Detailed Description

A landau-de gennes q-tensor framework force computer...currently working with the one-constant approximation for the distortion term.

Constructor & Destructor Documentation

◆ landauDeGennesLC() [1/4]

landauDeGennesLC::landauDeGennesLC ( bool  _neverGPU = false)

◆ landauDeGennesLC() [2/4]

landauDeGennesLC::landauDeGennesLC ( scalar  _A,
scalar  _B,
scalar  _C,
scalar  _L1 
)

◆ landauDeGennesLC() [3/4]

landauDeGennesLC::landauDeGennesLC ( scalar  _A,
scalar  _B,
scalar  _C,
scalar  _L1,
scalar  _L2,
scalar  _L3,
scalar  _L4,
scalar  _L6 
)

◆ landauDeGennesLC() [4/4]

landauDeGennesLC::landauDeGennesLC ( scalar  _A,
scalar  _B,
scalar  _C,
scalar  _L1,
scalar  _L2,
scalar  _L3orWavenumber,
distortionEnergyType  _type 
)

Member Function Documentation

◆ baseInitialization()

void landauDeGennesLC::baseInitialization ( )

set up a few basic things (common force tuners, number of energy components, etc.)

References boundaryForceTuner, computeEfieldContribution, computeHfieldContribution, energyComponents, fieldForceTuner, forceAssistTuner, baseLatticeForce::forceTuner, l24ForceTuner, and force::useNeighborList.

Referenced by landauDeGennesLC().

◆ setModel() [1/2]

void landauDeGennesLC::setModel ( shared_ptr< cubicLattice _model)
virtual

The model setting creates an additional data structure to help with 2- or 3- constant approximation.

Reimplemented from baseLatticeForce.

References energyDensity, energyDensityReduction, baseLatticeForce::lattice, force::model, multiConstant, numberOfConstants, and GPUArray< T >::resize().

◆ computeForces()

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

use the "type" flag to select either bulk or boundary routines

Reimplemented from baseLatticeForce.

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

◆ computeForceGPU()

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

◆ setPhaseConstants()

void landauDeGennesLC::setPhaseConstants ( scalar  _a = -1,
scalar  _b = -12.325581395,
scalar  _c = 10.058139535 
)
inline

References A, B, and C.

◆ setElasticConstants()

void landauDeGennesLC::setElasticConstants ( scalar  _l1 = 2.32,
scalar  _l2 = 0,
scalar  _l3 = 0,
scalar  _l4 = 0,
scalar  _l6 = 0 
)
inline

References L1, L2, L3, L4, and L6.

◆ setNumberOfConstants()

void landauDeGennesLC::setNumberOfConstants ( distortionEnergyType  _type)

References multiConstant, and numberOfConstants.

Referenced by landauDeGennesLC().

◆ computeForceCPU() [1/2]

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

◆ computeObjectForces()

void landauDeGennesLC::computeObjectForces ( int  objectIdx)
virtual

◆ computeFirstDerivatives()

void landauDeGennesLC::computeFirstDerivatives ( )
virtual

◆ computeStressTensors()

void landauDeGennesLC::computeStressTensors ( GPUArray< int > &  sites,
GPUArray< Matrix3x3 > &  stresses 
)
virtual

compute the stress tensors at the given set of sites

expression from "Hierarchical self-assembly of nematic colloidal superstructures" PHYSICAL REVIEW E 77, 061706 (2008)

References computeEnergyCPU(), computeFirstDerivatives(), ArrayHandle< T >::data, energyDensity, forceCalculationAssist, GPUArray< T >::getNumElements(), access_location::host, L1, n, numberOfConstants, oneConstant, access_mode::overwrite, access_mode::read, GPUArray< T >::resize(), Matrix3x3::set(), Matrix3x3::x11, Matrix3x3::x22, and Matrix3x3::x33.

Referenced by computeObjectForces().

◆ computeBoundaryForcesCPU()

void landauDeGennesLC::computeBoundaryForcesCPU ( GPUArray< dVec > &  forces,
bool  zeroOutForce 
)
virtual

◆ computeBoundaryForcesGPU()

void landauDeGennesLC::computeBoundaryForcesGPU ( GPUArray< dVec > &  forces,
bool  zeroOutForce 
)
virtual

◆ computeEorHFieldForcesCPU()

void landauDeGennesLC::computeEorHFieldForcesCPU ( GPUArray< dVec > &  forces,
bool  zeroOutForce,
scalar3  field,
scalar  anisotropicSusceptibility,
scalar  vacuumPermeability 
)
virtual

◆ computeEorHFieldForcesGPU()

void landauDeGennesLC::computeEorHFieldForcesGPU ( GPUArray< dVec > &  forces,
bool  zeroOutForce,
scalar3  field,
scalar  anisotropicSusceptibility,
scalar  vacuumPermeability 
)
virtual

◆ computeEnergyCPU()

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

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

Reimplemented from baseLatticeForce.

References A, B, C, Chi, computeBoundaryEnergy(), computeEfieldContribution, computeHfieldContribution, ArrayHandle< T >::data, deltaChi, deltaEpsilon, Efield, force::energy, energyComponents, energyDensity, epsilon, epsilon0, Hfield, L1, L2, L3, L4, L6, baseLatticeForce::lattice, mu0, force::neighbors, scalar, TrQ2(), TrQ2Squared(), and TrQ3().

Referenced by computeStressTensors().

◆ computeEnergyGPU()

void landauDeGennesLC::computeEnergyGPU ( bool  verbose = false)
virtual

◆ printTuners()

void landauDeGennesLC::printTuners ( )
inline

◆ setEField()

void landauDeGennesLC::setEField ( scalar3  field,
scalar  eps,
scalar  eps0,
scalar  deltaEps 
)
inline

◆ setHField()

void landauDeGennesLC::setHField ( scalar3  field,
scalar  chi,
scalar  _mu0,
scalar  _deltaChi 
)
inline

◆ getClassSize()

virtual scalar landauDeGennesLC::getClassSize ( )
inlinevirtual

◆ computeL1BulkCPU()

void landauDeGennesLC::computeL1BulkCPU ( GPUArray< dVec > &  forces,
bool  zeroOutForce 
)
protectedvirtual

◆ computeL1BoundaryCPU()

void landauDeGennesLC::computeL1BoundaryCPU ( GPUArray< dVec > &  forces,
bool  zeroOutForce 
)
protectedvirtual

◆ computeAllDistortionTermsBulkCPU()

void landauDeGennesLC::computeAllDistortionTermsBulkCPU ( GPUArray< dVec > &  forces,
bool  zeroOutForce 
)
protectedvirtual

◆ computeAllDistortionTermsBoundaryCPU()

void landauDeGennesLC::computeAllDistortionTermsBoundaryCPU ( GPUArray< dVec > &  forces,
bool  zeroOutForce 
)
protectedvirtual

◆ computeForceCPU() [2/2]

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

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

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

Referenced by baseLatticeForce::computeForces().

◆ setJ()

void baseLatticeForce::setJ ( scalar  _j)
inlineinherited

References baseLatticeForce::J.

◆ computeEnergy()

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

compute the energy associated with this force

Reimplemented from force.

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

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

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

◆ 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

◆ energyComponents

vector<scalar> landauDeGennesLC::energyComponents

A vector storing the components of energy (phase,distortion,anchoring)

Referenced by baseInitialization(), computeEnergyCPU(), and getClassSize().

◆ energyDensity

GPUArray<scalar> landauDeGennesLC::energyDensity

the free energy density at each lattice site

Referenced by computeEnergyCPU(), computeEnergyGPU(), computeStressTensors(), getClassSize(), landauDeGennesLC(), and setModel().

◆ energyDensityReduction

GPUArray<scalar> landauDeGennesLC::energyDensityReduction

A helper array for energy reductions.

Referenced by computeEnergyGPU(), landauDeGennesLC(), and setModel().

◆ objectForceArray

GPUArray<scalar3> landauDeGennesLC::objectForceArray

the force from stresses at the surface of an object

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

◆ A

scalar landauDeGennesLC::A
protected

◆ B

scalar landauDeGennesLC::B
protected

◆ C

scalar landauDeGennesLC::C
protected

◆ L1

scalar landauDeGennesLC::L1
protected

◆ L2

scalar landauDeGennesLC::L2
protected

◆ L3

scalar landauDeGennesLC::L3
protected

◆ L4

scalar landauDeGennesLC::L4
protected

◆ L6

scalar landauDeGennesLC::L6
protected

◆ q0

scalar landauDeGennesLC::q0
protected

◆ Efield

scalar3 landauDeGennesLC::Efield
protected

◆ deltaEpsilon

scalar landauDeGennesLC::deltaEpsilon
protected

◆ epsilon0

scalar landauDeGennesLC::epsilon0
protected

◆ epsilon

scalar landauDeGennesLC::epsilon
protected

◆ Hfield

scalar3 landauDeGennesLC::Hfield
protected

◆ deltaChi

scalar landauDeGennesLC::deltaChi
protected

◆ Chi

scalar landauDeGennesLC::Chi
protected

◆ mu0

scalar landauDeGennesLC::mu0
protected

◆ numberOfConstants

distortionEnergyType landauDeGennesLC::numberOfConstants
protected

◆ computeEfieldContribution

bool landauDeGennesLC::computeEfieldContribution
protected

switches for extra parts of the energy/force calculations

Referenced by baseInitialization(), computeEnergyCPU(), computeEnergyGPU(), computeForceCPU(), computeForceGPU(), and setEField().

◆ computeHfieldContribution

bool landauDeGennesLC::computeHfieldContribution
protected

◆ forceCalculationAssist

GPUArray<cubicLatticeDerivativeVector> landauDeGennesLC::forceCalculationAssist
protected

for 2- and 3- constant approximations, the force calculation is helped by first pre-computing first derivatives

Referenced by computeAllDistortionTermsBoundaryCPU(), computeAllDistortionTermsBulkCPU(), computeFirstDerivatives(), computeForceGPU(), computeStressTensors(), getClassSize(), and landauDeGennesLC().

◆ forceAssistTuner

shared_ptr<kernelTuner> landauDeGennesLC::forceAssistTuner
protected

performance for the first derivative calculation

Referenced by baseInitialization(), computeFirstDerivatives(), and printTuners().

◆ boundaryForceTuner

shared_ptr<kernelTuner> landauDeGennesLC::boundaryForceTuner
protected

performance for the boundary force kernel

Referenced by baseInitialization(), computeBoundaryForcesGPU(), computeEorHFieldForcesGPU(), and printTuners().

◆ l24ForceTuner

shared_ptr<kernelTuner> landauDeGennesLC::l24ForceTuner
protected

performance for the l24 force kernel

Referenced by baseInitialization().

◆ fieldForceTuner

shared_ptr<kernelTuner> landauDeGennesLC::fieldForceTuner
protected

performance for the E/H field force kernel

Referenced by baseInitialization(), and computeEorHFieldForcesGPU().

◆ forceTuner

shared_ptr<kernelTuner> baseLatticeForce::forceTuner
inherited

◆ lattice

shared_ptr<cubicLattice> baseLatticeForce::lattice
protectedinherited

◆ J

scalar baseLatticeForce::J
protectedinherited

◆ 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 setModel(), force::setModel(), and baseLatticeForce::setModel().

◆ useGPU

bool force::useGPU
inherited

◆ neverGPU

bool force::neverGPU
inherited

whether the updater never does work on the GPU

Referenced by landauDeGennesLC().

◆ energy

scalar force::energy
inherited

◆ 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().

◆ useNeighborList

bool force::useNeighborList
inherited

does the force get an assist from a neighbor list?

Referenced by baseInitialization(), baseLatticeForce::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: