https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: 10d9cfd92c6d8f632edc3207f7d96d8816168360 authored by montoyav on 12 March 2021, 08:40:23 UTC
Merge branch 'master' into 'cherry-pick-54f2208a'
Tip revision: 10d9cfd
ComputeResiduum.cpp
/**
 * \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
 */

#include "ComputeResiduum.h"

#include "MathLib/LinAlg/LinAlg.h"

namespace ProcessLib
{
GlobalVector computeResiduum(GlobalVector const& x, GlobalVector const& xdot,
                             GlobalMatrix const& M, GlobalMatrix const& K,
                             GlobalVector const& b)
{
    using namespace MathLib::LinAlg;
    GlobalVector residuum;
    matMult(M, xdot, residuum);
    matMultAdd(K, x, residuum, residuum);
    axpy(residuum, -1, b);
    scale(residuum, -1);
    return residuum;
}
}  // namespace ProcessLib
back to top