Code covered by the BSD License  

Highlights from
FELICITY

image thumbnail

FELICITY

by

 

21 Apr 2011 (Updated )

Finite ELement Implementation and Computational Interface Tool for You

GenMatrixAssemblyCode
% Class for Auto Generating Matrix Assembly Code
classdef GenMatrixAssemblyCode
    properties %(SetAccess='private',GetAccess='private')
        Skeleton_Dir          % directory where repository is stored
        Output_Dir            % where to put the generated code
        Sub_Dir               % struct containing sub-dir names
        Param                 % various parameters
        BEGIN_Auto_Gen        % string
        END_Auto_Gen          % string
        DEBUG                 % indicates whether to put debugging code in
    end
    methods
        function obj = GenMatrixAssemblyCode(varargin)
            
            if nargin ~= 2
                disp('Requires 2 arguments!');
                disp('First  is a string containing the directory where the generated code is placed.');
                disp('Second is a struct of parameters.');
                error('Check the arguments!');
            end
            
            OUT_str  = '|---> Init GenMatrixAssemblyCode Object...';
            disp(OUT_str);
            
            obj.Skeleton_Dir  = Get_Skeleton_Dir();
            obj.Output_Dir    = varargin{1};
            obj.Sub_Dir       = Get_Sub_Dir;
            obj.Param         = varargin{2};
            obj.Param         = []; % not used... yet.
            obj.DEBUG         = true;
            
            if ~ischar(obj.Skeleton_Dir)
                error('Input should be a string!');
            end
            if ~ischar(obj.Output_Dir)
                error('Input should be a string!');
            end
            
            if ~isdir(obj.Skeleton_Dir)
                error('Input is not a valid directory!');
            end
            if ~isdir(obj.Output_Dir)
                error('Input is not a valid directory!');
            end
            
            obj.BEGIN_Auto_Gen = '/*------------ BEGIN: Auto Generate ------------*/';
            obj.END_Auto_Gen   = '/*------------   END: Auto Generate ------------*/';
        end
    end
end

% END %

Contact us