#pragma once

#include "fesa/analysis/analysis_model.hpp"
#include "fesa/fem/dof_manager.hpp"
#include "fesa/math/sparse_matrix.hpp"
#include "fesa/math/vector.hpp"

namespace fesa {

// Assembles only semantic nodal CLOAD records and forms the eliminated free
// right-hand side; stiffness factorization remains an analysis responsibility.
class LoadAssembler {
public:
    static Result<Vector> assembleFullNodalLoad(
        const AnalysisModel& model,
        const DofManager& dofs);
    static Result<Vector> effectiveFreeRhs(
        const Vector& fullLoad,
        const SparseMatrix& kfc,
        const Vector& prescribedValues,
        const DofManager& dofs);
};

} // namespace fesa
