Changeset 9075


Ignore:
Timestamp:
07/19/11 16:28:47 (14 years ago)
Author:
Mathieu Morlighem
Message:

Simplified spcthickness (use new NaN scheme)

Location:
issm/trunk/src
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp

    r9002 r9075  
    4242
    4343        /*Transient or static?:*/
    44         if(M==iomodel->numberofvertices){ //{{{1
     44        if(M==iomodel->numberofvertices){
    4545                /*static: just create Spc objects*/
    46 
    47        
    48                 /*Initialize counter*/
    4946                count=0;
    5047       
     
    6057                                        count++;
    6158                                }
    62 
    63                         } //if((my_nodes[i]==1))
     59                        }
    6460                }
    65         } //}}}
    66         else{ //{{{1
     61        }
     62        else{
    6763                /*transient: create transient Spct objects. Same logic, except we need to retrieve
    6864                 * various times and values to initialize an Spct object: */
    69 
    70                 /*Initialize counter*/
    7165                count=0;
    7266
     
    7872                /*unit conversion: */
    7973                UnitConversion(times,N,ExtToIuEnum,TimeEnum);
    80 
    81 
    8274
    8375                /*Create spcs from x,y,z, as well as the spc values on those spcs: */
     
    10092                                }
    10193                                xfree((void**)&values);
    102                         } //if((my_nodes[i]==1))
     94                        }
    10395                }
    104         } //}}}
     96        }
    10597
    10698        /*Free ressources:*/
  • issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp

    r8926 r9075  
    1 /*
    2  * CreateConstraintsPrognostic.c:
    3  */
    4 
    51#include "../../../Container/Container.h"
     2#include "../../../modules/modules.h"
    63#include "../../../toolkits/toolkits.h"
    74#include "../../../EnumDefinitions/EnumDefinitions.h"
     
    2724        if(!constraints) constraints = new Constraints(ConstraintsEnum);
    2825
    29         /*Do not add constraints in DG*/
     26        /*Do not add constraints in DG, they are weakly imposed*/
    3027        if(!iomodel->prognostic_DG){
    31 
    32                 /*Fetch data: */
    33                 IoModelFetchData(&iomodel->spcthickness,NULL,NULL,iomodel_handle,SpcthicknessEnum);
    34 
    35                 /*Initialize counter*/
    36                 count=0;
    37 
    38                 /*Create spcs from x,y,z, as well as the spc values on those spcs: */
    39                 for (i=0;i<iomodel->numberofvertices;i++){
    40                         /*keep only this partition's nodes:*/
    41                         if((iomodel->my_vertices[i])){
    42 
    43                                 if ((int)iomodel->spcthickness[2*i]){
    44 
    45                                         constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,*(iomodel->spcthickness+2*i+1),PrognosticAnalysisEnum));
    46                                         count++;
    47                                 }
    48                         } //if((my_vertices[i]))
    49                 }
    50 
    51                 /*Free data: */
    52                 xfree((void**)&iomodel->spcthickness);
     28                IoModelToConstraintsx(constraints,iomodel,iomodel_handle,SpcthicknessEnum,PrognosticAnalysisEnum);
    5329        }
    5430
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r9012 r9075  
    775775        /*Constants*/
    776776        const int  numdof=NDOF2*NUMVERTICES;
     777        _error_("STOP");
    777778
    778779        /*Intermediaries*/
  • issm/trunk/src/m/classes/model.m

    r9013 r9075  
    1515                 name            = {'',true,'String'};
    1616                 runtimename     = {'',false}; %name used when running a parallel job
    17                  counter         = {0,false}; %1 mesh, 2 geography, 3 parameterize
     17                 counter         = {0,false};
    1818                 domainoutline   = {NaN,false};
    1919                 riftoutline     = {NaN,false};
     
    346346         end
    347347         methods (Static)
    348                  function md = loadobj(md) % {{{
     348                 function md = lllloadobj(md) % {{{
    349349                         % This function is directly called by matlab when a model object is
    350350                         % loaded. If the input is a struct it is an old version of model and
  • issm/trunk/src/m/model/display/displaybc.m

    r8823 r9075  
    2525
    2626disp(sprintf('\n      prognostic:'));
    27 fielddisplay(md,'spcthickness','constraints flag list (first column) and values (second column)');
     27fielddisplay(md,'spcthickness','thickness constraints (NaN means no constraint)');
    2828
    2929disp(sprintf('\n      thermal:'));
    30 fielddisplay(md,'spctemperature','constraints flag list (first column) and values (second column)');
     30fielddisplay(md,'spctemperature','temperature constraints (NaN means no constraint)');
    3131fielddisplay(md,'basal_melting_rate','basal melting rate [m/a]');
  • issm/trunk/src/m/model/display/displayprognostic.m

    r4965 r9075  
    1818
    1919disp(sprintf('\n      boundary conditions:'));
    20 fielddisplay(md,'spcthickness','constraints flag list (first column) and values (second column)');
     20fielddisplay(md,'spcthickness','thickness constraints (NaN means no constraint)');
  • issm/trunk/src/m/model/ismodelselfconsistent.m

    r9049 r9075  
    224224        if any(md.thickness<=0),
    225225                pos=find(md.thickness<=0);
    226                 if any(find(md.spcthickness(pos,1)==0)),
     226                if any(isnan(md.spcthickness(pos))),
    227227                        message(['model not consistent: model ' md.name ' has some nodes with 0 thickness']);
    228228                end
     
    369369                        if any(md.thickness<=0),
    370370                                pos=find(md.thickness<=0);
    371                                 if any(find(md.spcthickness(pos,1)==0)),
     371                                if any(isnan(md.spcthickness(pos))),
    372372                                        message(['model not consistent: model ' md.name ' has some nodes with 0 thickness']);
    373373                                end
     
    458458                        checksize(md,fields,[md.numberofnodes 1]);
    459459                        checknan(md,fields);
    460 
    461                         %CHECK THAT WE ARE NOT FULLY CONSTRAINED
    462                         if (md.dim==2),
    463                                 if isnan(find(~md.spcthickness(:,1))),
    464                                         message(['model not consistent: model ' md.name ' is totally constrained for prognostic, no need to solve!']);
    465                                 end
    466                         end
    467460                        %}}}
    468461                case HydrologyAnalysisEnum,
     
    560553                        checksize(md,fields,[md.numberofnodes 1]);
    561554                        checknan(md,fields);
    562 
    563                         %SPC                             
    564                         %       if ~md.prognostic_DG,
    565                         %               if any(md.spcthickness(find(md.nodeonboundary))~=1),             
    566                         %                       message(['model not consistent: model ' md.name ' should have all the nodes on boundary constrained in field spcthickness']);                   
    567                         %               end
    568                         %       end
    569555
    570556                        %Triangle with zero velocity
  • issm/trunk/src/m/model/outflow.m

    r8298 r9075  
    11function flag=outflow(md);
     2%OUTFLOW - flag nodes on outflux boundary
     3%
     4%   Usage:
     5%      flag=outflow(md);
    26
    37A=md.segments(:,1);
  • issm/trunk/src/m/solvers/solver_linear.m

    r8814 r9075  
    99
    1010        [K_ff,K_fs,p_f,df,kmax]=SystemMatrices(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters);
     11        full(K_ff)
     12        condest(K_ff)
    1113        ys  =CreateNodalConstraints(femmodel.nodes,configuration_type);
    1214        p_f =Reduceload( p_f, K_fs, ys);
     15        full(p_f)
    1316
    1417        issmprintf(VerboseSolver(),'%s%g','      condition number of stiffness matrix: ',condest(K_ff));
    1518        u_f=Solver(K_ff,p_f,[],df,femmodel.parameters);
     19        u_f
     20        error('stop')
    1621        u_g= Mergesolutionfromftog( u_f, ys, femmodel.nodes,femmodel.parameters);
    1722        [femmodel.elements,femmodel.materials]=InputUpdateFromSolution(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,u_g);
  • issm/trunk/src/m/utils/BC/SetIceSheetBC.m

    r9002 r9075  
    5858end
    5959
    60 md.spcthickness=zeros(md.numberofnodes,2);
     60md.spcthickness=NaN*ones(md.numberofnodes,1);
    6161
    6262if (length(md.observed_temperature)==md.numberofnodes),
  • issm/trunk/src/m/utils/BC/SetIceShelfBC.m

    r9002 r9075  
    9090end
    9191
    92 md.spcthickness=zeros(md.numberofnodes,2);
     92md.spcthickness=NaN*ones(md.numberofnodes,1);
    9393
    9494if (length(md.observed_temperature)==md.numberofnodes),
  • issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m

    r9002 r9075  
    101101end
    102102
    103 md.spcthickness=zeros(md.numberofnodes,2);
     103md.spcthickness=NaN*ones(md.numberofnodes,1);
    104104
    105105if (length(md.observed_temperature)==md.numberofnodes),
  • issm/trunk/src/m/utils/Interp/PatchToVec.m

    r8726 r9075  
    88switch(Patch.interpolation(1)),
    99        case P0Enum,
    10                 vec(Patch.element)=Patch.value;
     10                %vec(Patch.element)=Patch.value;
     11                connectivity=sparse(Patch.index(:),1,1);
     12                value       =sparse(Patch.index(:),1,Patch.value(:));
     13                vec=full(value./connectivity);
    1114        case P1Enum,
    1215                connectivity=sparse(Patch.index(:),1,1);
Note: See TracChangeset for help on using the changeset viewer.