diff --git a/NumLib/Fem/ShapeFunction/ShapePoint1-impl.h b/NumLib/Fem/ShapeFunction/ShapePoint1-impl.h new file mode 100644 index 0000000000000000000000000000000000000000..81907f2162d79b359fed5f6bb2e87195f656b31e --- /dev/null +++ b/NumLib/Fem/ShapeFunction/ShapePoint1-impl.h @@ -0,0 +1,19 @@ +/** + * \copyright + * Copyright (c) 2012-2015, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +namespace NumLib +{ + +template <class T_X, class T_N> +void ShapePoint1::computeShapeFunction(const T_X& /*r*/, T_N& N) +{ + N[0] = 1; +} + +} diff --git a/NumLib/Fem/ShapeFunction/ShapePoint1.h b/NumLib/Fem/ShapeFunction/ShapePoint1.h new file mode 100644 index 0000000000000000000000000000000000000000..8ce677719c86e0347d0c0803b764d1b0d5e99790 --- /dev/null +++ b/NumLib/Fem/ShapeFunction/ShapePoint1.h @@ -0,0 +1,36 @@ +/** + * \copyright + * Copyright (c) 2012-2015, 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 SHAPEPOINT1_H_ +#define SHAPEPOINT1_H_ + +#include "MeshLib/Elements/Point.h" + +namespace NumLib +{ +/// Shape function for a point element in natural coordinates. +class ShapePoint1 +{ +public: + /// Evaluate the shape function at the given point + /// + /// @param [in] r point coordinates + /// @param [out] N a vector of calculated shape function. + template <class T_X, class T_N> + static void computeShapeFunction(const T_X& r, T_N& N); + + using MeshElement = MeshLib::Point; + static const std::size_t DIM = MeshElement::dimension; + static const std::size_t NPOINTS = MeshElement::n_all_nodes; +}; +} + +#include "ShapePoint1-impl.h" + +#endif // SHAPEPOINT1_H_