OGS
ProcessLib/LIE/Common/Utils.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <Eigen/Core>
7
9#include "MeshLib/Node.h"
10
11namespace ProcessLib
12{
13namespace LIE
14{
17template <typename Derived>
19 MeshLib::Element const& e, Eigen::MatrixBase<Derived> const& shape)
20{
21 Eigen::Vector3d pt = Eigen::Vector3d::Zero();
22 for (unsigned i = 0; i < e.getNumberOfNodes(); i++)
23 {
24 MeshLib::Node const& node = *e.getNode(i);
25 for (unsigned j = 0; j < 3; j++)
26 {
27 pt[j] += shape[i] * node[j];
28 }
29 }
30 return pt;
31}
32
33} // namespace LIE
34} // namespace ProcessLib
virtual unsigned getNumberOfNodes() const =0
virtual const Node * getNode(unsigned idx) const =0
Eigen::Vector3d computePhysicalCoordinates(MeshLib::Element const &e, Eigen::MatrixBase< Derived > const &shape)