Commit 43eae007 authored by Sreekanth Arikatla's avatar Sreekanth Arikatla

REFAC: Refactor long lines of code

parent eeb81a4c
......@@ -101,12 +101,14 @@ public:
/// \brief Check if cell index in dimension d is valid (d = 0/1/2 => x/y/z dimension)
///
template<int d>
bool isValidCellIndex(const int idx) const { return idx >= 0 && static_cast<unsigned int>(idx) < m_Resolution[d]; }
bool isValidCellIndex(const int idx) const
{ return idx >= 0 && static_cast<unsigned int>(idx) < m_Resolution[d]; }
///
/// \brief Check if 3D cell indices are valid
///
bool isValidCellIndices(const int i, const int j, const int k) const { return isValidCellIndex<0>(i) && isValidCellIndex<1>(j) && isValidCellIndex<2>(k); }
bool isValidCellIndices(const int i, const int j, const int k) const
{ return isValidCellIndex<0>(i) && isValidCellIndex<1>(j) && isValidCellIndex<2>(k); }
///
/// \brief Get the 3D index (cell_x, cell_y, cell_z) of the cell containing the given positions
......@@ -136,53 +138,77 @@ public:
/// \brief Get data in a cell
/// \param A position in space
///
CellData& getCellData(const Vec3r& ppos) { return m_CellData[getCellLinearizedIndex < unsigned int > (ppos)]; }
CellData& getCellData(const Vec3r& ppos)
{
return m_CellData[getCellLinearizedIndex < unsigned int > (ppos)];
}
///
/// \brief Get data in a cell
/// \param A position in space
///
const CellData& getCellData(const Vec3r& ppos) const { return m_CellData[getCellLinearizedIndex < unsigned int > (ppos)]; }
const CellData& getCellData(const Vec3r& ppos) const
{ return m_CellData[getCellLinearizedIndex < unsigned int > (ppos)]; }
///
/// \brief Get data in a cell
/// \param A linearized index of cell
///
CellData& getCellData(size_t linearizedIdx) { assert(linearizedIdx < m_CellData.size()); return m_CellData[linearizedIdx]; }
CellData& getCellData(size_t linearizedIdx)
{
assert(linearizedIdx < m_CellData.size());
return m_CellData[linearizedIdx];
}
///
/// \brief Get data in a cell
/// \param A linearized index of cell
///
const CellData& getCellData(size_t linearizedIdx) const { assert(linearizedIdx < m_CellData.size()); return m_CellData[linearizedIdx]; }
const CellData& getCellData(size_t linearizedIdx) const
{
assert(linearizedIdx < m_CellData.size());
return m_CellData[linearizedIdx];
}
///
/// \brief Get data in a cell
/// \param 3D index of a cell
///
template<class IndexType>
CellData& getCellData(const std::array<IndexType, 3>& cellIdx) { return m_CellData[getCellLinearizedIndex(cellIdx[0], cellIdx[1], cellIdx[2])]; }
CellData& getCellData(const std::array<IndexType, 3>& cellIdx)
{
return m_CellData[getCellLinearizedIndex(cellIdx[0], cellIdx[1], cellIdx[2])];
}
///
/// \brief Get data in a cell
/// \param 3D index of a cell
///
template<class IndexType>
const CellData& getCellData(const std::array<IndexType, 3>& cellIdx) const { return m_CellData[getCellLinearizedIndex(cellIdx[0], cellIdx[1], cellIdx[2])]; }
const CellData& getCellData(const std::array<IndexType, 3>& cellIdx) const
{
return m_CellData[getCellLinearizedIndex(cellIdx[0], cellIdx[1], cellIdx[2])];
}
///
/// \brief Get data in a cell
/// \param 3D index of a cell
///
template<class IndexType>
CellData& getCellData(const IndexType i, const IndexType j, const IndexType k) { return m_CellData[getCellLinearizedIndex(i, j, k)]; }
CellData& getCellData(const IndexType i, const IndexType j, const IndexType k)
{
return m_CellData[getCellLinearizedIndex(i, j, k)];
}
///
/// \brief Get data in a cell
/// \param 3D index of a cell
///
template<class IndexType>
const CellData& getCellData(const IndexType i, const IndexType j, const IndexType k) const { return m_CellData[getCellLinearizedIndex(i, j, k)]; }
const CellData& getCellData(const IndexType i, const IndexType j, const IndexType k) const
{
return m_CellData[getCellLinearizedIndex(i, j, k)];
}
///
/// \brief Apply a function to all cell data
......
......@@ -23,4 +23,4 @@ imstk_add_library( DynamicalModels
#-----------------------------------------------------------------------------
if( iMSTK_BUILD_TESTING )
add_subdirectory( Testing )
endif()
endif()
\ No newline at end of file
......@@ -36,8 +36,6 @@ enum class DynamicalModelType
elastoDynamics,
positionBasedDynamics,
SPH,
NavierStokes,
HeatEquation,
none
};
......
......@@ -140,7 +140,7 @@ public:
///
/// \brief Rewire the node order and triangle connectivity to optimize for memory layout
/// The intended use is for large meshes that doesn't fit into CPU/GPU memory.
/// TODO: Further optimization to find a 1-d uninterrupted sub-graph at each iteration.
/// \todo Further optimization to find a 1-d uninterrupted sub-graph at each iteration.
///
void optimizeForDataLocality();
......@@ -202,7 +202,8 @@ public:
///
/// \brief Set load factor
/// \param loadFactor the maximum number of vertices; a multiple of the original vertex count
/// \param loadFactor the maximum number of vertices
/// a multiple of the original vertex count
///
virtual void setLoadFactor(double loadFactor) override;
......
......@@ -69,7 +69,7 @@ protected:
VolumetricMesh(Geometry::Type type, const std::string name = std::string("")) : PointSet(type, name) {}
std::shared_ptr<SurfaceMesh> m_attachedSurfaceMesh = nullptr; ///> Attached surface mesh
std::shared_ptr<vega::VolumetricMesh> m_attachedVegaMesh = nullptr; ///> Attached vega mesh
std::shared_ptr<SurfaceMesh> m_attachedSurfaceMesh; ///> Attached surface mesh
std::shared_ptr<vega::VolumetricMesh> m_attachedVegaMesh; ///> Attached vega mesh
};
} // imstk
......@@ -55,9 +55,10 @@ public:
static std::shared_ptr<imstk::VolumetricMesh> read(const std::string& filePath, const MeshFileType meshType);
protected:
//
// \brief Possible element types in a MSH file format as mentioned at http://www.manpagez.com/info/gmsh/gmsh-2.2.6/gmsh_63.php
//
///
/// \brief Possible element types in a MSH file format
/// as mentioned at http://www.manpagez.com/info/gmsh/gmsh-2.2.6/gmsh_63.php
///
enum ElemType
{
line=1,
......
......@@ -95,7 +95,7 @@ VTKTetrahedralMeshRenderDelegate::updateDataSource()
if (geometry->getTopologyChangedFlag())
{
m_mappedVertexArray->Modified(); // TODO: only modify if vertices change
m_mappedVertexArray->Modified(); /// \todo only modify if vertices change
// Copy cells
auto& maskedTets = std::dynamic_pointer_cast<TetrahedralMesh>(geometry)->getRemovedTetrahedra();
......
......@@ -42,7 +42,8 @@ public:
///
/// \brief Set the simulation object
///
void setSPHObject(const std::shared_ptr<SPHObject>& obj) { assert(obj); m_SPHObject = obj; }
void setSPHObject(const std::shared_ptr<SPHObject>& obj)
{ assert(obj); m_SPHObject = obj; }
///
/// \brief Advance one time step
......
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