https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: 68f182c58738c298fe6dd88600e79db03d7c2f3b authored by Dmitry Yu. Naumov on 05 October 2016, 21:47:36 UTC
Merge pull request #1463 from chleh/improve-docu-part5
Tip revision: 68f182c
ElementCoordinatesMappingLocal.h
/**
 * \copyright
 * Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 */

#ifndef ELEMENTCOORDINATESMAPPINGLOCAL_H_
#define ELEMENTCOORDINATESMAPPINGLOCAL_H_

#include <vector>
#include <Eigen/Eigen>
#include "MathLib/Point3d.h"

namespace MeshLib
{
    class Element;
}

namespace MeshLib
{
typedef Eigen::Matrix<double, 3u, 3u, Eigen::RowMajor> RotationMatrix;

/**
 * This class maps node coordinates on intrinsic coordinates of the given element.
 */
class ElementCoordinatesMappingLocal final
{
public:
    /**
     * Constructor
     * \param e          Mesh element whose node coordinates are mapped
     * \param global_dim Global dimension
     */
    ElementCoordinatesMappingLocal(const Element &e, const unsigned global_dim);

    /// return the global dimension
    unsigned getGlobalDimension() const { return _global_dim; }

    /// return mapped coordinates of the node
    MathLib::Point3d const& getMappedCoordinates(std::size_t node_id) const
    {
        return _points[node_id];
    }

    /// return a rotation matrix converting to global coordinates
    const RotationMatrix& getRotationMatrixToGlobal() const {return _matR2global;}

private:
    const unsigned _global_dim;
    std::vector<MathLib::Point3d> _points;
    RotationMatrix _matR2global;
};

}

#endif // ELEMENTCOORDINATESMAPPINGLOCAL_H_
back to top