Skip to content
Snippets Groups Projects
Commit 0f03d927 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

Merge branch 'SmallImprovements' into 'master'

[MeL] Small code quality improvements.

See merge request ogs/ogs!3799
parents 4fcc8bb8 fd0e7605
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,8 @@ void Element::setNeighbor(Element* neighbor, unsigned const face_id)
std::optional<unsigned> Element::addNeighbor(Element* e)
{
if (e == this || e == nullptr || e->getDimension() != this->getDimension())
const unsigned dim(this->getDimension());
if (e == this || e == nullptr || e->getDimension() != dim)
{
return std::optional<unsigned>();
}
......@@ -56,7 +57,6 @@ std::optional<unsigned> Element::addNeighbor(Element* e)
const unsigned eNodes(e->getNumberOfBaseNodes());
const Node* const* e_nodes = e->getNodes();
unsigned count(0);
const unsigned dim(this->getDimension());
for (unsigned i(0); i < nNodes; i++)
{
for (unsigned j(0); j < eNodes; j++)
......
......@@ -68,7 +68,7 @@ public:
virtual Node* const* getNodes() const = 0;
/// Get dimension of the mesh element.
virtual unsigned getDimension() const = 0;
virtual constexpr unsigned getDimension() const = 0;
/// Returns the i-th edge of the element.
virtual const Element* getEdge(unsigned i) const = 0;
......
......@@ -74,7 +74,7 @@ public:
}
/// Get dimension of the mesh element.
unsigned getDimension() const override { return dimension; }
constexpr unsigned getDimension() const override { return dimension; }
/// Returns the edge i of the element.
const Element* getEdge(unsigned i) const override
{
......
......@@ -18,11 +18,9 @@
#include <vtkType.h>
#include "BaseLib/Logging.h"
#include "GeoLib/Raster.h"
#include "MeshLib/Location.h"
#include "MeshLib/MeshEnums.h"
#include "MeshLib/Node.h"
#include "MeshLib/Properties.h"
#include "MeshLib/PropertyVector.h"
......@@ -32,7 +30,8 @@ class vtkDataArray; // For node/cell properties
namespace MeshLib
{
class Mesh;
class Properties;
class Element;
class Node;
/**
* \brief Converter for VtkUnstructured Grids to OGS meshes
......
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