swh:1:snp:f521c49ab17ef7db6ec70b2430e1ed203f50383f
Raw File
Tip revision: f54d85bb8013757f8aa186a73aed2fd5c9204cb0 authored by montoyav on 05 November 2020, 21:12:15 UTC
Replace HC-Process.pdf
Tip revision: f54d85b
ComputeResiduum.cpp
/**
 * \file
 * \copyright
 * Copyright (c) 2012-2020, 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