https://github.com/penn-graphics-research/ziran2019
Raw File
Tip revision: 8d3d27cd17bbceab18c317820dbe595178f6312a authored by fangy14 on 06 November 2019, 07:20:57 UTC
open source
Tip revision: 8d3d27c
GlobalSystem.h
#ifndef GLOBAL_SYSTEM_H
#define GLOBAL_SYSTEM_H

#include <Ziran/Math/Linear/DenseExt.h>

namespace ZIRAN {

template <class Simulation, int dim>
class GlobalSystem {
public:
    using T = typename Simulation::Scalar;
    using TVStack = Matrix<T, dim, Eigen::Dynamic>;

    std::function<void(TVStack&)> project;
    std::function<void(const TVStack&, TVStack&)> precondition;
    std::function<void(const TVStack&, TVStack&)> multiply;
    std::function<T(const TVStack&)> residual;

    template <class Func>
    void setMultiplier(Func multiply_func)
    {
        multiply = multiply_func;
    }

    template <class Func>
    void setProjection(Func project_func)
    {
        project = project_func;
    }

    template <class Func>
    void setPreconditioner(Func preconditioner_func)
    {
        precondition = preconditioner_func;
    }

    template <class Func>
    void setResidual(Func residual_func)
    {
        residual = residual_func;
    }
};
} // namespace ZIRAN

#endif
back to top