Revision a76943b4cb8836eec2122d136a69e4ee1b030fec authored by Tom Fischer on 07 July 2021, 07:30:50 UTC, committed by Tom Fischer on 07 July 2021, 07:30:50 UTC
[PL] Use int type for GlobalDim template argument. See merge request ogs/ogs!3692
Divergence.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
namespace ProcessLib
{
namespace Deformation
{
/// Divergence of displacement, the volumetric strain.
template <int DisplacementDim, int NPOINTS, typename DNDX_Type>
double divergence(
const Eigen::Ref<Eigen::Matrix<double, NPOINTS * DisplacementDim, 1> const>&
u,
DNDX_Type const& dNdx)
{
double divergence = 0;
for (int i = 0; i < DisplacementDim; ++i)
{
divergence += dNdx.template block<1, NPOINTS>(i, 0) *
u.template segment<NPOINTS>(i * NPOINTS);
}
return divergence;
}
} // namespace Deformation
} // namespace ProcessLib
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...