/*******************************************************************************
 * Copyright (C) 2017-2026 Theodore Chang
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
/**
 * @class Load
 * @brief A Load class.
 *
 * The Load class is in charge of returning load level according to given time
 * increment.
 *
 * @author tlc
 * @date 01/10/2017
 * @version 0.2.0
 * @file Load.h
 * @addtogroup Load
 * @{
 */

#ifndef LOAD_H
#define LOAD_H

#include <Domain/ConditionalModifier.h>

class Load : public ConditionalModifier {
    static double multiplier;

protected:
    const double magnitude;

    vec trial_load;
    vec trial_settlement;
    sp_vec reference_load;

    friend void set_load_multiplier(double);

public:
    Load(
        unsigned,                 // tag
        unsigned,                 // amplitude tag
        std::vector<Node::DOF>&&, // dof order
        std::vector<Node::DOF>&&, // dof component (unordered)
        double                    // nominal magnitude
    );

    [[nodiscard]] virtual bool if_displacement_control() const { return false; }

    [[nodiscard]] const vec& get_trial_load() const;
    [[nodiscard]] const vec& get_trial_settlement() const;
    [[nodiscard]] const sp_vec& get_reference_load() const;
};

void set_load_multiplier(double);

#endif

//! @}
