Commit eeb81a4c authored by Sreekanth Arikatla's avatar Sreekanth Arikatla

REFAC: Enforce lower camel case for data members

parent c3ed9f21
......@@ -136,7 +136,7 @@ generateFluid(const std::shared_ptr<Scene>& scene, const double particleRadius)
// Create a fluids object
auto fluidObj = std::make_shared<SPHObject>("Sphere");
// Create a visiual model
// Create a visual model
auto fluidVisualModel = std::make_shared<VisualModel>(fluidGeometry);
auto fluidMaterial = std::make_shared<RenderMaterial>();
fluidMaterial->setColor(Color::Blue);
......@@ -152,14 +152,14 @@ generateFluid(const std::shared_ptr<Scene>& scene, const double particleRadius)
sphParams->m_bNormalizeDensity = true;
if (SCENE_ID == 2) // highly viscous fluid
{
sphParams->m_RatioKernelOverParticleRadius = 6.0;
sphParams->m_ViscosityFluid = 0.5;
sphParams->m_SurfaceTensionStiffness = 5.0;
sphParams->m_kernelOverParticleRadiusRatio = 6.0;
sphParams->m_viscosityCoeff = 0.5;
sphParams->m_surfaceTensionStiffness = 5.0;
}
if (SCENE_ID == 3) // bunny-shaped fluid
{
sphParams->m_BoundaryFriction = 0.3;
sphParams->m_frictionBoundary= 0.3;
}
sphModel->configure(sphParams);
......
......@@ -42,7 +42,7 @@ SPHCollisionHandling::processCollisionData()
LOG_IF(FATAL, (!SPHModel)) << "SPH model was not initialized";
#endif
const auto boundaryFriction = m_SPHObject->getSPHModel()->getParameters()->m_BoundaryFriction;
const auto boundaryFriction = m_SPHObject->getSPHModel()->getParameters()->m_frictionBoundary;
#if defined(DEBUG) || defined(_DEBUG) || !defined(NDEBUG)
LOG_IF(FATAL, (boundaryFriction<0.0 || boundaryFriction>1.0))
<< "Invalid boundary friction coefficient (value must be in [0, 1])";
......
......@@ -30,7 +30,7 @@ namespace imstk
///
/// \struct stdSink
///
/// \brief
/// \brief A standard sink that prints the message to a standard output
///
struct stdSink
{
......
......@@ -393,7 +393,8 @@ PbdModel::initializeConstantDensityConstraint(const double stiffness)
&& m_mesh->getType() != Geometry::Type::HexahedralMesh
&& m_mesh->getType() != Geometry::Type::PointSet)
{
LOG(WARNING) << "Constant constraint should come with a mesh"; //\todo Really only need a point cloud, so may need to change this.
//\todo Really only need a point cloud, so may need to change this.
LOG(WARNING) << "Constant constraint should come with a mesh!";
return false;
}
......
......@@ -432,7 +432,8 @@ protected:
} // end namespace SPH
///
/// \brief Struct contains SPH kernels for time integration, using different kernel for different purposes
/// \brief Class contains SPH kernels for time integration,
/// using different kernel for different purposes
///
class SPHSimulationKernels
{
......
......@@ -27,51 +27,59 @@ namespace imstk
{
SPHModelConfig::SPHModelConfig(const Real particleRadius)
{
m_ParticleRadius = particleRadius;
if (std::abs(particleRadius) > Real(1.e-6))
{
LOG_IF(WARNING, (particleRadius < 0)) << "Particle radius supplied is negative! Using absolute value of the supplied radius.";
m_particleRadius = std::abs(particleRadius);
}
else
{
LOG(WARNING, "Particle radius too small! Setting to 1.e-6");
m_particleRadius = 1.e-6;
}
initialize();
}
void
SPHModelConfig::initialize()
{
LOG_IF(FATAL, (std::abs(m_ParticleRadius) < Real(1e-6))) << "Particle radius was not set properly";
m_ParticleRadiusSqr = m_ParticleRadius * m_ParticleRadius;
// Compute the derived quantities
m_particleRadiusSqr = m_particleRadius * m_particleRadius;
m_ParticleMass = Real(std::pow(Real(2.0) * m_ParticleRadius, 3)) * m_RestDensity * m_ParticleMassScale;
m_RestDensitySqr = m_RestDensity * m_RestDensity;
m_RestDensityInv = Real(1) / m_RestDensity;
m_particleMass = Real(std::pow(Real(2.0) * m_particleRadius, 3)) * m_restDensity * m_particleMassScale;
m_restDensitySqr = m_restDensity * m_restDensity;
m_restDensityInv = Real(1) / m_restDensity;
m_KernelRadius = m_ParticleRadius * m_RatioKernelOverParticleRadius;
m_KernelRadiusSqr = m_KernelRadius * m_KernelRadius;
m_kernelRadius = m_particleRadius * m_kernelOverParticleRadiusRatio;
m_kernelRadiusSqr = m_kernelRadius * m_kernelRadius;
}
bool
SPHModel::initialize()
{
LOG_IF(FATAL, (!m_Geometry)) << "Model geometry is not yet set! Cannot initialize without model geometry.";
LOG_IF(FATAL, (!m_geometry)) << "Model geometry is not yet set! Cannot initialize without model geometry.";
// Initialize positions and velocity of the particles
this->m_initialState = std::make_shared<SPHKinematicState>();
this->m_currentState = std::make_shared<SPHKinematicState>();
// Set particle positions and zero default velocities
// TODO: set particle data with given (non-zero) velocities
this->m_initialState->setParticleData(m_Geometry->getVertexPositions());
/// \todo set particle data with given (non-zero) velocities
this->m_initialState->setParticleData(m_geometry->getVertexPositions());
this->m_currentState->setState(this->m_initialState);
// Attach current state to simulation state
m_SimulationState.setKinematicState(this->m_currentState);
m_simulationState.setKinematicState(this->m_currentState);
// Initialize (allocate memory for) simulation data such as density, acceleration etc.
m_SimulationState.initializeData();
m_simulationState.initializeData();
// Initialize simulation dependent parameters and kernel data
m_Kernels.initialize(m_Parameters->m_KernelRadius);
m_kernels.initialize(m_modelParameters->m_kernelRadius);
// Initialize neighbor searcher
m_NeighborSearcher = std::make_shared<NeighborSearch>(m_Parameters->m_NeighborSearchMethod,
m_Parameters->m_KernelRadius);
m_neighborSearcher = std::make_shared<NeighborSearch>(m_modelParameters->m_NeighborSearchMethod,
m_modelParameters->m_kernelRadius);
return true;
}
......@@ -95,7 +103,7 @@ SPHModel::advanceTimeStep()
void
SPHModel::computeTimeStepSize()
{
m_dt = (this->m_timeStepSizeType == TimeSteppingType::fixed) ? m_DefaultDt : computeCFLTimeStepSize();
m_dt = (this->m_timeStepSizeType == TimeSteppingType::fixed) ? m_defaultDt : computeCFLTimeStepSize();
}
Real
......@@ -104,16 +112,18 @@ SPHModel::computeCFLTimeStepSize()
auto maxVel = ParallelUtils::findMaxL2Norm(getState().getVelocities());
// dt = CFL * 2r / max{|| v ||}
Real timestep = maxVel > Real(1e-6) ? m_Parameters->m_CFLFactor * (Real(2.0) * m_Parameters->m_ParticleRadius / maxVel) : m_Parameters->m_MaxTimestep;
Real timestep = maxVel > Real(1e-6) ?
m_modelParameters->m_CFLFactor * (Real(2.0) * m_modelParameters->m_particleRadius / maxVel) :
m_modelParameters->m_maxTimestep;
// clamp the time step size to be within a given range
if (timestep > m_Parameters->m_MaxTimestep)
if (timestep > m_modelParameters->m_maxTimestep)
{
timestep = m_Parameters->m_MaxTimestep;
timestep = m_modelParameters->m_maxTimestep;
}
else if (timestep < m_Parameters->m_MinTimestep)
else if (timestep < m_modelParameters->m_minTimestep)
{
timestep = m_Parameters->m_MinTimestep;
timestep = m_modelParameters->m_minTimestep;
}
return timestep;
......@@ -122,11 +132,12 @@ SPHModel::computeCFLTimeStepSize()
void
SPHModel::findParticleNeighbors()
{
m_NeighborSearcher->getNeighbors(getState().getFluidNeighborLists(), getState().getPositions());
if (m_Parameters->m_bDensityWithBoundary) // if considering boundary particles for computing fluid density
m_neighborSearcher->getNeighbors(getState().getFluidNeighborLists(), getState().getPositions());
if (m_modelParameters->m_bDensityWithBoundary) // if considering boundary particles for computing fluid density
{
m_NeighborSearcher->getNeighbors(getState().getBoundaryNeighborLists(), getState().getPositions(),
getState().getBoundaryParticlePositions());
m_neighborSearcher->getNeighbors(getState().getBoundaryNeighborLists(),
getState().getPositions(),
getState().getBoundaryParticlePositions());
}
}
......@@ -139,7 +150,7 @@ SPHModel::computeNeighborRelativePositions()
{
const Vec3r& qpos = allPositions[q];
const Vec3r r = ppos - qpos;
neighborInfo.push_back({ r, m_Parameters->m_RestDensity });
neighborInfo.push_back({ r, m_modelParameters->m_restDensity });
}
};
......@@ -152,7 +163,7 @@ SPHModel::computeNeighborRelativePositions()
computeRelativePositions(ppos, getState().getFluidNeighborLists()[p], getState().getPositions(), neighborInfo);
// if considering boundary particles then also cache relative positions with them
if (m_Parameters->m_bDensityWithBoundary)
if (m_modelParameters->m_bDensityWithBoundary)
{
computeRelativePositions(ppos, getState().getBoundaryNeighborLists()[p], getState().getBoundaryParticlePositions(), neighborInfo);
}
......@@ -163,7 +174,7 @@ void
SPHModel::collectNeighborDensity()
{
// after computing particle densities, cache them into neighborInfo variable, next to relative positions
// this is usefull because relative positions and densities are accessed together multiple times
// this is useful because relative positions and densities are accessed together multiple times
// caching relative positions and densities therefore can reduce computation time significantly (tested)
ParallelUtils::parallelFor(getState().getNumParticles(),
[&](const size_t p) {
......@@ -196,9 +207,9 @@ SPHModel::computeDensity()
Real pdensity = 0;
for (const auto& qInfo : neighborInfo)
{
pdensity += m_Kernels.W(qInfo.xpq);
pdensity += m_kernels.W(qInfo.xpq);
}
pdensity *= m_Parameters->m_ParticleMass;
pdensity *= m_modelParameters->m_particleMass;
getState().getDensities()[p] = pdensity;
});
}
......@@ -206,7 +217,7 @@ SPHModel::computeDensity()
void
SPHModel::normalizeDensity()
{
if (!m_Parameters->m_bNormalizeDensity)
if (!m_modelParameters->m_bNormalizeDensity)
{
return;
}
......@@ -230,10 +241,10 @@ SPHModel::normalizeDensity()
// because we're not done with density computation, qInfo does not contain desity of particle q yet
const auto q = fluidNeighborList[i];
const auto qdensity = getState().getDensities()[q];
tmp += m_Kernels.W(qInfo.xpq) / qdensity;
tmp += m_kernels.W(qInfo.xpq) / qdensity;
}
if (m_Parameters->m_bDensityWithBoundary)
if (m_modelParameters->m_bDensityWithBoundary)
{
const auto& BDNeighborList = getState().getBoundaryNeighborLists()[p];
#if defined(DEBUG) || defined(_DEBUG) || !defined(NDEBUG)
......@@ -243,11 +254,11 @@ SPHModel::normalizeDensity()
for (size_t i = fluidNeighborList.size(); i < neighborInfo.size(); ++i)
{
const auto& qInfo = neighborInfo[i];
tmp += m_Kernels.W(qInfo.xpq) / m_Parameters->m_RestDensity; // density of boundary particle is set to rest density
tmp += m_kernels.W(qInfo.xpq) / m_modelParameters->m_restDensity; // density of boundary particle is set to rest density
}
}
getState().getNormalizedDensities()[p] = getState().getDensities()[p] / (tmp * m_Parameters->m_ParticleMass);
getState().getNormalizedDensities()[p] = getState().getDensities()[p] / (tmp * m_modelParameters->m_particleMass);
});
// put normalized densities to densities
......@@ -258,7 +269,7 @@ void
SPHModel::computePressureAcceleration()
{
auto particlePressure = [&](const Real density) {
const Real error = std::pow(density / m_Parameters->m_RestDensity, 7) - Real(1);
const Real error = std::pow(density / m_modelParameters->m_restDensity, 7) - Real(1);
// clamp pressure error to zero to maintain stability
return error > Real(0) ? error : Real(0);
};
......@@ -284,10 +295,10 @@ SPHModel::computePressureAcceleration()
const auto qpressure = particlePressure(qdensity);
// pressure forces
accel += -(ppressure / (pdensity * pdensity) + qpressure / (qdensity * qdensity)) * m_Kernels.gradW(r);
accel += -(ppressure / (pdensity * pdensity) + qpressure / (qdensity * qdensity)) * m_kernels.gradW(r);
}
accel *= m_Parameters->m_PressureStiffness * m_Parameters->m_ParticleMass;
accel *= m_modelParameters->m_pressureStiffness * m_modelParameters->m_particleMass;
getState().getAccelerations()[p] = accel;
});
}
......@@ -297,7 +308,7 @@ SPHModel::updateVelocity(Real timestep)
{
ParallelUtils::parallelFor(getState().getNumParticles(),
[&](const size_t p) {
getState().getVelocities()[p] += (m_Parameters->m_Gravity + getState().getAccelerations()[p]) * timestep;
getState().getVelocities()[p] += (m_modelParameters->m_gravity + getState().getAccelerations()[p]) * timestep;
});
}
......@@ -324,23 +335,23 @@ SPHModel::computeViscosity()
const auto& qInfo = neighborInfo[i];
const auto r = qInfo.xpq;
const auto qdensity = qInfo.density;
diffuseFluid += (Real(1.0) / qdensity) * m_Kernels.W(r) * (qvel - pvel);
diffuseFluid += (Real(1.0) / qdensity) * m_kernels.W(r) * (qvel - pvel);
}
diffuseFluid *= m_Parameters->m_ViscosityFluid;
diffuseFluid *= m_modelParameters->m_viscosityCoeff;
Vec3r diffuseBoundary(0, 0, 0);
if (m_Parameters->m_bDensityWithBoundary)
if (m_modelParameters->m_bDensityWithBoundary)
{
for (size_t i = fluidNeighborList.size(); i < neighborInfo.size(); ++i)
{
const auto& qInfo = neighborInfo[i];
const auto r = qInfo.xpq;
diffuseBoundary -= m_Parameters->m_RestDensityInv * m_Kernels.W(r) * pvel;
diffuseBoundary -= m_modelParameters->m_restDensityInv * m_kernels.W(r) * pvel;
}
diffuseBoundary *= m_Parameters->m_ViscosityBoundary;
diffuseBoundary *= m_modelParameters->m_viscosityBoundary;
}
getState().getDiffuseVelocities()[p] = (diffuseFluid + diffuseBoundary) * m_Parameters->m_ParticleMass;
getState().getDiffuseVelocities()[p] = (diffuseFluid + diffuseBoundary) * m_modelParameters->m_particleMass;
});
// add diffused velocity back to velocity, causing viscosity
......@@ -350,11 +361,10 @@ SPHModel::computeViscosity()
});
}
// Compute surface tension Akinci et at. 2013 model (Versatile Surface Tension and Adhesion for SPH Fluids)
void
SPHModel::computeSurfaceTension()
{
// Firstly compute surface normal for all particles
// First, compute surface normal for all particles
ParallelUtils::parallelFor(getState().getNumParticles(),
[&](const size_t p) {
Vec3r n(0, 0, 0);
......@@ -370,14 +380,14 @@ SPHModel::computeSurfaceTension()
const auto& qInfo = neighborInfo[i];
const auto r = qInfo.xpq;
const auto qdensity = qInfo.density;
n += (Real(1.0) / qdensity) * m_Kernels.gradW(r);
n += (Real(1.0) / qdensity) * m_kernels.gradW(r);
}
n *= m_Parameters->m_KernelRadius * m_Parameters->m_ParticleMass;
n *= m_modelParameters->m_kernelRadius * m_modelParameters->m_particleMass;
getState().getNormals()[p] = n;
});
// Compute surface tension acceleration
// Second, compute surface tension acceleration
ParallelUtils::parallelFor(getState().getNumParticles(),
[&](const size_t p) {
const auto& fluidNeighborList = getState().getFluidNeighborLists()[p];
......@@ -402,14 +412,14 @@ SPHModel::computeSurfaceTension()
const auto qdensity = qInfo.density;
// Correction factor
const auto K_ij = Real(2) * m_Parameters->m_RestDensity / (pdensity + qdensity);
const auto K_ij = Real(2) * m_modelParameters->m_restDensity / (pdensity + qdensity);
// Cohesion acc
auto r = qInfo.xpq;
const auto d2 = r.squaredNorm();
if (d2 > Real(1e-20))
{
accel -= K_ij * m_Parameters->m_ParticleMass * (r / std::sqrt(d2)) * m_Kernels.cohesionW(r);
accel -= K_ij * m_modelParameters->m_particleMass * (r / std::sqrt(d2)) * m_kernels.cohesionW(r);
}
// Curvature acc
......@@ -417,7 +427,7 @@ SPHModel::computeSurfaceTension()
accel -= K_ij * (ni - nj);
}
accel *= m_Parameters->m_SurfaceTensionStiffness;
accel *= m_modelParameters->m_surfaceTensionStiffness;
getState().getAccelerations()[p] += accel;
});
}
......
......@@ -31,7 +31,7 @@ namespace imstk
{
///
/// \class SPHModelConfig
/// \brief Parameters for SPH simulation
/// \brief Class that holds the SPH model parameters
///
class SPHModelConfig
{
......@@ -41,65 +41,49 @@ private:
public:
SPHModelConfig(const Real particleRadius);
////////////////////////////////////////////////////////////////////////////////
// TODO: Move this to solver or time integrator in the future
Real m_MinTimestep = Real(1e-6);
Real m_MaxTimestep = Real(1e-3);
/// \todo Move this to solver or time integrator in the future
Real m_minTimestep = Real(1e-6);
Real m_maxTimestep = Real(1e-3);
Real m_CFLFactor = Real(1.0);
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// particle parameters
Real m_ParticleRadius = Real(0);
Real m_ParticleRadiusSqr = Real(0);
////////////////////////////////////////////////////////////////////////////////
Real m_particleRadius = Real(0);
Real m_particleRadiusSqr = Real(0); ///> \note derived quantity
////////////////////////////////////////////////////////////////////////////////
// material parameters
Real m_RestDensity = Real(1000.0);
Real m_RestDensitySqr = Real(1000000.0);
Real m_RestDensityInv = Real(1.0 / 1000.0);
Real m_ParticleMass = Real(1);
Real m_ParticleMassScale = Real(0.95); // scale particle mass to a smaller value to maintain stability
Real m_restDensity = Real(1000.0);
Real m_restDensitySqr = Real(1000000.0); ///> \note derived quantity
Real m_restDensityInv = Real(1.0 / 1000.0); ///> \note derived quantity
Real m_particleMass = Real(1);
Real m_particleMassScale = Real(0.95); ///> scale particle mass to a smaller value to maintain stability
bool m_bNormalizeDensity = false;
bool m_bDensityWithBoundary = false;
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// pressure
Real m_PressureStiffness = Real(50000.0);
////////////////////////////////////////////////////////////////////////////////
Real m_pressureStiffness = Real(50000.0);
////////////////////////////////////////////////////////////////////////////////
// viscosity and surface tension/cohesion
Real m_ViscosityFluid = Real(1e-2);
Real m_ViscosityBoundary = Real(1e-5);
Real m_SurfaceTensionStiffness = Real(1);
Real m_BoundaryFriction = Real(0.1);
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// kernel data
Real m_RatioKernelOverParticleRadius = Real(4.0);
Real m_KernelRadius;
Real m_KernelRadiusSqr;
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
Real m_viscosityCoeff = Real(1e-2);
Real m_viscosityBoundary = Real(1e-5);
Real m_surfaceTensionStiffness = Real(1);
Real m_frictionBoundary = Real(0.1);
// kernel properties
Real m_kernelOverParticleRadiusRatio = Real(4.0);
Real m_kernelRadius; ///> \note derived quantity
Real m_kernelRadiusSqr; ///> \note derived quantity
// gravity
Vec3r m_Gravity = Vec3r(0, -9.81, 0);
////////////////////////////////////////////////////////////////////////////////
Vec3r m_gravity = Vec3r(0, -9.81, 0);
////////////////////////////////////////////////////////////////////////////////
// neighbor search
NeighborSearch::Method m_NeighborSearchMethod = NeighborSearch::Method::UniformGridBasedSearch;
////////////////////////////////////////////////////////////////////////////////
};
///
/// \class SPHModel
/// \brief SPH simulation model
/// \brief SPH fluid model
///
class SPHModel : public DynamicalModel<SPHKinematicState>
{
......@@ -117,12 +101,12 @@ public:
///
/// \brief Set simulation parameters
///
void configure(const std::shared_ptr<SPHModelConfig>& params) { m_Parameters = params; }
void configure(const std::shared_ptr<SPHModelConfig>& params) { m_modelParameters = params; }
///
/// \brief Set the geometry (particle positions)
///
void setModelGeometry(const std::shared_ptr<PointSet>& geo) { m_Geometry = geo; }
void setModelGeometry(const std::shared_ptr<PointSet>& geo) { m_geometry = geo; }
///
/// \brief Initialize the dynamical model
......@@ -137,44 +121,61 @@ public:
///
/// \brief Update positions of point set geometry
///
virtual void updatePhysicsGeometry() override { assert(m_Geometry); m_Geometry->setVertexPositions(this->m_currentState->getPositions()); }
virtual void updatePhysicsGeometry() override
{ assert(m_geometry); m_geometry->setVertexPositions(this->m_currentState->getPositions()); }
///
/// \brief Reset the current state to the initial state
///
virtual void resetToInitialState() override { this->m_currentState->setState(this->m_initialState); }
virtual void resetToInitialState() override
{ this->m_currentState->setState(this->m_initialState); }
///
/// \brief Get the simulation parameters
///
const std::shared_ptr<SPHModelConfig>& getParameters() const { assert(m_Parameters); return m_Parameters; }
const std::shared_ptr<SPHModelConfig>& getParameters() const
{ assert(m_modelParameters); return m_modelParameters; }
///
/// \brief Get the kinematics particle data (positions + velocities)
///
SPHKinematicState& getKinematicsState() { assert(this->m_currentState); return *this->m_currentState; }
const SPHKinematicState& getKinematicsState() const { assert(this->m_currentState); return *this->m_currentState; }
SPHKinematicState& getKinematicsState()
{
assert(this->m_currentState);
return *this->m_currentState;
}
const SPHKinematicState& getKinematicsState() const
{
assert(this->m_currentState);
return *this->m_currentState;
}
///
/// \brief Get particle simulation data
///
SPHSimulationState& getState() { return m_SimulationState; }
const SPHSimulationState& getState() const { return m_SimulationState; }
SPHSimulationState& getState() { return m_simulationState; }
const SPHSimulationState& getState() const { return m_simulationState; }
///
/// \brief Set the default time step size, valid only if using a fixed time step for integration
/// \brief Set the default time step size,
/// valid only if using a fixed time step for integration
///
virtual void setTimeStep(const double timeStep) override { setDefaultTimeStep(static_cast<Real>(timeStep)); }
virtual void setTimeStep(const double timeStep) override
{ setDefaultTimeStep(static_cast<Real>(timeStep)); }
///
/// \brief Set the default time step size, valid only if using a fixed time step for integration
/// \brief Set the default time step size,
/// valid only if using a fixed time step for integration
///
void setDefaultTimeStep(const Real timeStep) { m_DefaultDt = static_cast<Real>(timeStep); }
void setDefaultTimeStep(const Real timeStep)
{ m_defaultDt = static_cast<Real>(timeStep); }
///
/// \brief Returns the time step size
///
virtual double getTimeStep() const override { return static_cast<double>(m_dt); }
virtual double getTimeStep() const override
{ return static_cast<double>(m_dt); }
///
/// \brief Do one time step simulation
......@@ -203,7 +204,8 @@ private:
void computeNeighborRelativePositions();
///
/// \brief Collect the densities of neighbor particles, called after all density computation (after density normalizaton, if applicable)
/// \brief Collect the densities of neighbor particles,
/// called after all density computation (after density normalization, if applicable)
///
void collectNeighborDensity();
......@@ -234,6 +236,8 @@ private:
///
/// \brief Compute surface tension and update velocities
/// Compute surface tension using Akinci et at. 2013 model
/// (Versatile Surface Tension and Adhesion for SPH Fluids)
///
void computeSurfaceTension();
......@@ -242,14 +246,14 @@ private:
///
void moveParticles(const Real timestep);
std::shared_ptr<PointSet> m_Geometry;
SPHSimulationState m_SimulationState;
std::shared_ptr<PointSet> m_geometry;
SPHSimulationState m_simulationState;
Real m_dt; ///> time step size
Real m_DefaultDt; ///> default time step size
Real m_defaultDt; ///> default time step size
SPHSimulationKernels m_Kernels; // must be initialized during model initialization
std::shared_ptr<SPHModelConfig> m_Parameters; // must be set before simulation
std::shared_ptr<NeighborSearch> m_NeighborSearcher; // must be initialized during model initialization
SPHSimulationKernels m_kernels; ///> SPH kernels (must be initialized during model initialization)
std::shared_ptr<SPHModelConfig> m_modelParameters; ///> SPH Model parameters (must be set before simulation)
std::shared_ptr<NeighborSearch> m_neighborSearcher; ///> Neighbor Search (must be initialized during model initialization)
};
} // end namespace imstk
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment