https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: 96111f90bdbf7a0d4bc66830225f35163543f34b authored by Tom Fischer on 22 April 2021, 12:38:27 UTC
Merge branch 'FixParallelOutputBug' into 'master'
Tip revision: 96111f9
FaceRule.h
/**
 * \file
 * \copyright
 * Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 *
 */

#pragma once

#include "Element.h"

namespace MeshLib
{

class FaceRule
{
public:
    /// Constant: Dimension of this mesh element
    static const unsigned dimension = 2u;

    /// Returns the face i of the element.
    static const Element* getFace(const Element* e, unsigned i) { return e->getEdge(i); }

    /// Constant: The number of faces
    static const unsigned n_faces = 0;

    /**
     * Checks if the node order of an element is correct by testing surface normals.
     * For 2D elements true is returned if the normal points (roughly) upwards.
     */
    static bool testElementNodeOrder(const Element* /*e*/);

    /// \returns the first vector forming the surface' plane
    static Eigen::Vector3d getFirstSurfaceVector(Element const* const e);

    /// \returns the second vector forming the surface' plane
    static Eigen::Vector3d getSecondSurfaceVector(Element const* const e);

    /// Returns the surface normal of a 2D element.
    static Eigen::Vector3d getSurfaceNormal(const Element* e);

}; /* class */

}  // namespace MeshLib
back to top