https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: 6b4231d16cd2782b9cfa61d37dbb1c6b67ffc3d9 authored by Lars Bilke on 11 April 2023, 07:49:28 UTC
Merge branch 'fix-docs-threshold' into 'master'
Tip revision: 6b4231d
FlipElements.h
/**
 * \file
 * \copyright
 * Copyright (c) 2012-2023, 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 <memory>
#include <vector>
#include "MeshLib/Elements/Element.h"

namespace MeshLib
{
class Mesh;
class Node;

/**
 * Creates a copy of an 1d / 2d element where the node order is reversed,
 * such that the direction of a line changes and normals of 2D elements
 * changes its sign.
 * @param elem original element
 * @param nodes node vector used for the copy of the element
 * @return a flipped copy of the element
 */
std::unique_ptr<Element> createFlippedElement(Element const& elem,
                                              std::vector<Node*> const& nodes);

/**
 * Creates a copy of a 1d / 2d mesh where the node order of all elements
 * is reversed such that the direction of lines changes and normals of
 * 2D elements changes their sign.
 * @param mesh input mesh
 * @return a flipped copy of the input mesh
 */
std::unique_ptr<Mesh> createFlippedMesh(Mesh const& mesh);

}  // namespace MeshLib
back to top