MpcGrids

PURPOSE ^

MPCGRIDS - build the matrix R_mg

SYNOPSIS ^

function R_mg=MpcGrids(grids,constraints)

DESCRIPTION ^

MPCGRIDS - build the matrix R_mg

   see NastranRgbDoc documentation in theoryguide directory

   Usage:
      R_mg=MpcGrids(grids,constraints)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function R_mg=MpcGrids(grids,constraints)
0002 %MPCGRIDS - build the matrix R_mg
0003 %
0004 %   see NastranRgbDoc documentation in theoryguide directory
0005 %
0006 %   Usage:
0007 %      R_mg=MpcGrids(grids,constraints)
0008 
0009 %compute number of equations described by our rgbs
0010 num_eq=0;
0011 gsize=getdofcount(grids);
0012 
0013 for i=1:length(constraints),
0014     if strcmpi(constraints(i).constraint.type,'rgb'),
0015         num_eq=num_eq+1;
0016     end
0017 end
0018 
0019 %allocate R_mg (num_eq,gsize)
0020 R_mg=sparse(num_eq,gsize);
0021 
0022 count=0;
0023 for i=1:length(constraints),
0024     if strcmpi(constraints(i).constraint.type,'rgb'),
0025         %recover rgb constraint
0026         rgbconstraint=constraints(i).constraint;
0027         count=count+1;
0028         %figure out whith degrees of freedom this RGB is supposed to connect
0029         dof1=grids(rgbconstraint.grid1).grid.doflist(rgbconstraint.dof);
0030         dof2=grids(rgbconstraint.grid2).grid.doflist(rgbconstraint.dof);
0031         %plug rcb coefficients into R_mg
0032         R_mg(count,dof1)=1;
0033         R_mg(count,dof2)=-1; %basically, we want dof1 and dof2 to be equal, for grids 1 and 2
0034     end
0035 end

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003