classdef ReducedStructuralModel
% pde.ReducedStructuralModel - Structural reduced-order model
%
% ReducedStructuralModel methods:
%   reconstructSolution - Reconstruct transient structural results
%
% ReducedStructuralModel properties:
%   K                    - Reduced stiffness matrix
%   M                    - Reduced mass matrix
%   NumModes             - Number of fixed interface modes
%   RetainedDoF          - IDs of the retained DoF with respect to original model
%   ReferenceLocations   - Reference location coordinates  for multipoint constraints
%   Mesh                 - Discretization of the domain

% Copyright 2019-2023 The MathWorks, Inc.


    properties(SetAccess = protected)
        %Reduced K
        K;

        %Reduced M
        M;
        
        % Number of fixed interface modes
        NumModes;
        
        % Retained DoF
        RetainedDoF;
                
        % MPC interface locations
        ReferenceLocations
        
        % Mesh
        Mesh
    end
    
    
    properties(SetAccess = protected, Hidden = true)

    
        % Transformation 
        TransformationMatrix;
        
        % MPC Transformation
        MPCTransformationMatrix
        
        % Model object with data for reconstruction
        ModelForReconstruction

        % Coefficients for post-processing.
        Coefficients
    end
    
    
    methods
        function obj = ReducedStructuralModel(spdem,Kr,Mr,AttachedDoF,W,Np,MPCReference,Tr,tmodel,coefstruct)
            if nargin == 0
                return
            end
            obj.K = Kr;
            obj.M = Mr;
            obj.RetainedDoF = AttachedDoF;
            obj.TransformationMatrix = W;
            obj.ReferenceLocations = MPCReference';
            obj.Mesh = spdem.Mesh;
            obj.NumModes = Np;
            obj.MPCTransformationMatrix = Tr;
            obj.ModelForReconstruction = tmodel;
            obj.Coefficients = coefstruct;
        end
        
        Rtrans= reconstructSolution(obj,varargin);
    end
    

end
