Skip to content
Snippets Groups Projects
Unverified Commit c972683d authored by Lars Bilke's avatar Lars Bilke Committed by GitHub
Browse files

Merge pull request #2771 from endJunction/Cleanups

Doxygen cleanups
parents 47e95fb9 6d7d2f13
No related branches found
No related tags found
No related merge requests found
\ogs_missing_documentation
\ogs_missing_documentation
...@@ -94,12 +94,12 @@ public: ...@@ -94,12 +94,12 @@ public:
Mat const& getRawMatrix() const { return _A; } Mat const& getRawMatrix() const { return _A; }
/// Set all entries to zero. /// Set all entries to zero.
void setZero() { MatZeroEntries(_A); } void setZero() { MatZeroEntries(_A); }
/* /*!
\brief Set the specified rows to zero except diagonal entries, i.e. \brief Set the specified rows to zero except diagonal entries, i.e.
\f$A(k, j) = \begin{cases} \f$A(k, j) = \begin{cases}
0.0, &j\not=k, j=1,2,\dots,k-1, k+1, \dots, n 0.0, &j\not=k, j=1,2,\dots,k-1, k+1, \dots, n \\
1.0, &j = k 1.0, &j = k
\end{cases}f$, where \f$k \in \mbox{row\_pos}\f$ \end{cases}\f$, where \f$k \in \mbox{row\_pos}\f$
This function must be called by all ranks. This function must be called by all ranks.
\param row_pos The row indicies of the specified rows. \param row_pos The row indicies of the specified rows.
*/ */
...@@ -273,4 +273,4 @@ void PETScMatrix::add(std::vector<PetscInt> const& row_pos, ...@@ -273,4 +273,4 @@ void PETScMatrix::add(std::vector<PetscInt> const& row_pos,
bool finalizeMatrixAssembly( bool finalizeMatrixAssembly(
PETScMatrix& mat, const MatAssemblyType asm_type = MAT_FINAL_ASSEMBLY); PETScMatrix& mat, const MatAssemblyType asm_type = MAT_FINAL_ASSEMBLY);
} // end namespace } // namespace MathLib
...@@ -47,52 +47,45 @@ std::vector<MeshLib::Element*> copyElementVector( ...@@ -47,52 +47,45 @@ std::vector<MeshLib::Element*> copyElementVector(
return new_elements; return new_elements;
} }
/// Copies an element without change, using the nodes vector from the result
/// mesh.
template <typename E>
MeshLib::Element* copyElement(MeshLib::Element const* const element, MeshLib::Element* copyElement(MeshLib::Element const* const element,
const std::vector<MeshLib::Node*>& nodes) const std::vector<MeshLib::Node*>& nodes)
{ {
if (element->getGeomType() == MeshElemType::LINE) auto** new_nodes = new MeshLib::Node*[element->getNumberOfNodes()];
{ for (unsigned i = 0; i < element->getNumberOfNodes(); ++i)
return copyElement<MeshLib::Line>(element, nodes);
}
if (element->getGeomType() == MeshElemType::TRIANGLE)
{
return copyElement<MeshLib::Tri>(element, nodes);
}
if (element->getGeomType() == MeshElemType::QUAD)
{
return copyElement<MeshLib::Quad>(element, nodes);
}
if (element->getGeomType() == MeshElemType::TETRAHEDRON)
{
return copyElement<MeshLib::Tet>(element, nodes);
}
if (element->getGeomType() == MeshElemType::HEXAHEDRON)
{
return copyElement<MeshLib::Hex>(element, nodes);
}
if (element->getGeomType() == MeshElemType::PYRAMID)
{
return copyElement<MeshLib::Pyramid>(element, nodes);
}
if (element->getGeomType() == MeshElemType::PRISM)
{ {
return copyElement<MeshLib::Prism>(element, nodes); new_nodes[i] = nodes[element->getNode(i)->getID()];
} }
return new E(new_nodes);
ERR("Error: Unknown element type.");
return nullptr;
} }
template <typename E>
MeshLib::Element* copyElement(MeshLib::Element const* const element, MeshLib::Element* copyElement(MeshLib::Element const* const element,
const std::vector<MeshLib::Node*>& nodes) const std::vector<MeshLib::Node*>& nodes)
{ {
auto** new_nodes = new MeshLib::Node*[element->getNumberOfNodes()]; switch (element->getGeomType())
for (unsigned i = 0; i < element->getNumberOfNodes(); ++i)
{ {
new_nodes[i] = nodes[element->getNode(i)->getID()]; case MeshElemType::LINE:
return copyElement<MeshLib::Line>(element, nodes);
case MeshElemType::TRIANGLE:
return copyElement<MeshLib::Tri>(element, nodes);
case MeshElemType::QUAD:
return copyElement<MeshLib::Quad>(element, nodes);
case MeshElemType::TETRAHEDRON:
return copyElement<MeshLib::Tet>(element, nodes);
case MeshElemType::HEXAHEDRON:
return copyElement<MeshLib::Hex>(element, nodes);
case MeshElemType::PYRAMID:
return copyElement<MeshLib::Pyramid>(element, nodes);
case MeshElemType::PRISM:
return copyElement<MeshLib::Prism>(element, nodes);
default:
{
ERR ("Error: Unknown element type.");
return nullptr;
}
} }
return new E(new_nodes);
} }
std::vector<MeshLib::Element*> cloneElements( std::vector<MeshLib::Element*> cloneElements(
......
...@@ -41,12 +41,6 @@ std::vector<MeshLib::Element*> copyElementVector( ...@@ -41,12 +41,6 @@ std::vector<MeshLib::Element*> copyElementVector(
MeshLib::Element* copyElement(MeshLib::Element const* const element, MeshLib::Element* copyElement(MeshLib::Element const* const element,
const std::vector<MeshLib::Node*>& nodes); const std::vector<MeshLib::Node*>& nodes);
/// Copies an element without change, using the nodes vector from the result
/// mesh.
template <typename E>
MeshLib::Element* copyElement(MeshLib::Element const* const element,
const std::vector<MeshLib::Node*>& nodes);
/// Clones a vector of elements using the Element::clone() function. /// Clones a vector of elements using the Element::clone() function.
std::vector<MeshLib::Element*> cloneElements( std::vector<MeshLib::Element*> cloneElements(
std::vector<MeshLib::Element*> const& elements); std::vector<MeshLib::Element*> const& elements);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment