CreateFEMModel

PURPOSE ^

-----------------------------------------------------------------------

SYNOPSIS ^

function m=CreateFEMModel(md,analysis_type )

DESCRIPTION ^

-----------------------------------------------------------------------
    CreateFEMModel.m: from a matlab ISSM @model class object, create a finite element 
                  compatible with Cielo.

-----------------------------------------------------------------------

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %-----------------------------------------------------------------------
0002 %    CreateFEMModel.m: from a matlab ISSM @model class object, create a finite element
0003 %                  compatible with Cielo.
0004 %
0005 %-----------------------------------------------------------------------
0006 function  m=CreateFEMModel(md,analysis_type )
0007 
0008     global ParameterDefaults
0009 
0010 %    read input data:
0011 
0012     disp(sprintf('\n   reading data from model %s...',md.name));
0013     [m.ncase, m.dynamic, m.ept, m.geom1, m.geom1b, m.geom2, m.part, m.tpart, m.geom3, ...
0014         m.geom4, m.mpt, m.pvt, m.sets, m.dit] = Imp( md ,analysis_type);
0015         
0016 %    generate list of states from case control (ncase), if any:
0017 
0018     disp('   generating states...');
0019     [m.states] = GenerateStates( m.ncase, m.dynamic);
0020     
0021     %ncase not needed anymore
0022     m=rmfield(m,'ncase');
0023 
0024 %    generate grid point definition table
0025 %    (internal grid records, contain sil and uset data)
0026     
0027     disp('   generating gpdt...');
0028     [m.gpdt,m.gpdtb] = Gp1( m.geom1, m.geom1b);
0029 
0030     
0031 %    generate coordinate system transformation matrices, transform
0032 %    grids to basic coordinate system
0033 
0034     disp('   generating updated gpdt...');
0035     [m.cstm, m.bgpdt, m.bgpdtb] = Gp1b( m.geom1, m.geom1b, m.gpdt, m.gpdtb);
0036 
0037     m=rmfield(m,'gpdt');
0038     if ~isempty(m.gpdtb), m=rmfield(md,'gpdtb');end;
0039 
0040     %geom1 and geom1b not needed anymore
0041     m=rmfield(m,'geom1');
0042     if ~isempty(m.geom1b), m=rmfield(m,'geom1b'); end;
0043 
0044     %disp('   generating element objects...');
0045     [m.est,m.lst] = Gp2( m.bgpdt, m.bgpdtb, m.ept, m.geom2, m.mpt, m.geom3);
0046 
0047     %geom2 not needed anymore
0048     m=rmfield(m,'geom2');
0049 
0050 %    phase 1:
0051 %
0052     
0053 %    set parameters using bulk data, nastran case control above subcase level:
0054     current_state = {};
0055     [next_state] = NextState( m.states, current_state);
0056     m.current_state = next_state;
0057     clear next_state current_state;
0058 
0059     [m.params] = Pvt( m.current_state, m.pvt);
0060     
0061 
0062 %    generate usets and constraint matrices:
0063 
0064     disp('   generating uset data and constraints...');
0065 
0066     [m.updated_bgpdt, m.updated_bgpdtb, m.y_g, m.R_mg] = Gp4( m.states, m.geom4, m.bgpdt, m.bgpdtb,analysis_type);
0067     
0068     
0069     %geom4 not needed anymore
0070     if ~isempty(m.geom4), m=rmfield(m,'geom4');end;
0071 
0072 %    replace old bgpdt with new (bgpdt unchanged if nonexistent updated_bgpdt):
0073     m.bgpdt = m.updated_bgpdt;m=rmfield(m,'updated_bgpdt');
0074     if ~isempty(m.updated_bgpdtb),
0075         m.bgpdtb = m.updated_bgpdtb;
0076         m=rmfield(m,'updated_bgpdtb');
0077     end;
0078 
0079 %   create uset table
0080     m.uset=Builduset(m.bgpdt,m.bgpdtb,analysis_type); 
0081 
0082     
0083 %
0084 %    phase 1:
0085 %
0086 %    autospc operations:
0087 %    autospc is done on the g_set, it should be done on the n_set later
0088 
0089 %    Partition R_mg into R_mm and R_mn, and
0090 %    calculate G_mn = - R_mm^-1 * R_mn  (MCE1 type operations)
0091 
0092     [m.G_mn] = Normalizeconstraints( m.R_mg, m.uset);
0093 
0094 %    Reduce enforced displacements / temperatures
0095     [m.y_s] = Reducevectorg( m.y_g ,m.uset);
0096     
0097 
0098     if isempty(m.y_s),
0099         flag_y_s= 0;
0100     else
0101         flag_y_s= 1;
0102     end
0103 end

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