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

Matrices
% FELICITY class for processing level 1 user code.
% This defines a Matrices object.  This is for collecting all the Forms together
% and outputting it to the code generation routines.
%
%   obj        = Matrices(Quad_Order,GeoElem);
%
%   Quad_Order = positive integer representing the quadrature order to use when
%                generating code to assemble matrices.
%   GeoElem    = GeoElement that specifies how the global domain (mesh) geometry
%                is represented.
classdef Matrices
    properties %(SetAccess=private,GetAccess=private)
        Quad_Order        % positive integer representing the quadrature order to use.
        GeoElem           % this stores how the geometry is represented.
        Matrix_Data       % this stores (multiple) matrix defn(s).
        C_Codes           % struct containing filename info for C-Code to include.
    end
    methods
        function obj = Matrices(varargin)
            
            if (nargin ~= 2)
                disp('Requires 2 arguments!');
                disp('First  is a positive integer representing the quadrature order.');
                disp('Second is a GeoElement.');
                error('Check the arguments!');
            end
            
            obj.Quad_Order   = varargin{1};
            obj.GeoElem      = varargin{2};
            obj.GeoElem.Name = inputname(2);
            obj.Matrix_Data  = [];
            obj.C_Codes      = [];
            
            if (obj.Quad_Order < 1)
                error('Quadrature order must be >= 1!');
            end
            if ~isa(obj.GeoElem,'GeoElement')
                error('Second argument must be a GeoElement!');
            end
        end
    end
end

% END %

Contact us