/** * \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 #include #include "MathLib/LinAlg/Eigen/EigenMapTools.h" namespace ProcessLib { /// In-place transpose. A helper function for the integration point data /// getters. /// For time being Eigen's transposeInPlace doesn't work for non-square mapped /// matrices. template std::vector transposeInPlace( StoreValuesFunction const& store_values_function) { std::vector result; store_values_function(result); MathLib::toMatrix< Eigen::Matrix>( result, result.size() / Components, Components) = MathLib::toMatrix< Eigen::Matrix>( result, Components, result.size() / Components) .transpose() .eval(); return result; } } // namespace ProcessLib