Changeset 8319


Ignore:
Timestamp:
05/16/11 16:58:02 (14 years ago)
Author:
Mathieu Morlighem
Message:

Added isdiagnostic isthermal and isprognostic flags

Location:
issm/trunk/src
Files:
3 added
14 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h

    r8302 r8319  
    443443        VxMeshEnum,
    444444        VyMeshEnum,
    445         VzMeshEnum
     445        VzMeshEnum,
     446        IsDiagnosticEnum,
     447        IsPrognosticEnum,
     448        IsThermalEnum
    446449};
    447450
  • issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp

    r8287 r8319  
    387387                case VyMeshEnum : return "VyMesh";
    388388                case VzMeshEnum : return "VzMesh";
     389                case IsDiagnosticEnum : return "IsDiagnostic";
     390                case IsPrognosticEnum : return "IsPrognostic";
     391                case IsThermalEnum : return "IsThermal";
    389392                default : return "unknown";
    390393
  • issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp

    r7848 r8319  
    8080        parameters->AddObject(new IntParam(GroundingLineMigrationEnum,iomodel->gl_migration));
    8181        parameters->AddObject(new IntParam(RheologyLawEnum,iomodel->rheology_law));
     82        parameters->AddObject(new BoolParam(IsDiagnosticEnum,iomodel->isdiagnostic));
     83        parameters->AddObject(new BoolParam(IsPrognosticEnum,iomodel->isprognostic));
     84        parameters->AddObject(new BoolParam(IsThermalEnum,iomodel->isthermal));
    8285
    8386        /*Deal with more complex parameters*/
  • issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp

    r8287 r8319  
    385385        else if (strcmp(name,"VyMesh")==0) return VyMeshEnum;
    386386        else if (strcmp(name,"VzMesh")==0) return VzMeshEnum;
     387        else if (strcmp(name,"IsDiagnostic")==0) return IsDiagnosticEnum;
     388        else if (strcmp(name,"IsPrognostic")==0) return IsPrognosticEnum;
     389        else if (strcmp(name,"IsThermal")==0) return IsThermalEnum;
    387390        else _error_("Enum %s not found",name);
    388391
  • issm/trunk/src/c/objects/IoModel.cpp

    r8315 r8319  
    200200        IoModelFetchData(&this->kff,iomodel_handle,"kff");
    201201        IoModelFetchData(&this->gl_migration,iomodel_handle,"gl_migration");
    202         IoModelFetchData(&this->diagnostic_analysis,iomodel_handle,"diagnostic_analysis");
    203         IoModelFetchData(&this->prognostic_analysis,iomodel_handle,"prognostic_analysis");
    204         IoModelFetchData(&this->thermal_analysis,iomodel_handle,"thermal_analysis");
     202        IoModelFetchData(&this->isdiagnostic,iomodel_handle,"isdiagnostic");
     203        IoModelFetchData(&this->isprognostic,iomodel_handle,"isprognostic");
     204        IoModelFetchData(&this->isthermal,iomodel_handle,"isthermal");
    205205
    206206        /*!Get thermal parameters: */
     
    371371        this->shelf_dampening=0;
    372372        this->waitonlock=0;
    373         this->diagnostic_analysis=0;
    374         this->prognostic_analysis=0;
    375         this->thermal_analysis=0;
     373        this->isdiagnostic=0;
     374        this->isprognostic=0;
     375        this->isthermal=0;
    376376
    377377        /*!thermal parameters: */
  • issm/trunk/src/c/objects/IoModel.h

    r8315 r8319  
    163163                double  waitonlock;
    164164                int     kff;
    165                 int     diagnostic_analysis;
    166                 int     prognostic_analysis;
    167                 int     thermal_analysis;
     165                int     isdiagnostic;
     166                int     isprognostic;
     167                int     isthermal;
    168168
    169169                /*thermal parameters: */
  • issm/trunk/src/c/solutions/transient2d_core.cpp

    r7809 r8319  
    2020        int    dim                  = -1;
    2121        int    solution_type;
    22         bool   control_analysis;
     22        bool   control_analysis,isdiagnostic,isprognostic,isthermal;
    2323        bool   time_adapt=false;
    2424        int    output_frequency;
     
    3939        femmodel->parameters->FindParam(&time_adapt,TimeAdaptEnum);
    4040        femmodel->parameters->FindParam(&gl_migration,GroundingLineMigrationEnum);
     41        femmodel->parameters->FindParam(&isdiagnostic,IsDiagnosticEnum);
     42        femmodel->parameters->FindParam(&isprognostic,IsPrognosticEnum);
     43        femmodel->parameters->FindParam(&isthermal,IsThermalEnum);
    4144
    4245        /*initialize: */
     
    5760                _printf_(VerboseSolution(),"%s%g%s%i%s%g%s%g\n","time [yr]: ",time/yts,"    iteration number: ",step,"/",floor((finaltime-time)/dt)," dt [yr]: ",dt/yts);
    5861
    59                 _printf_(VerboseSolution(),"%s\n","   computing new velocity");
    60                 diagnostic_core(femmodel);
     62                if(isdiagnostic){
     63                        _printf_(VerboseSolution(),"%s\n","   computing new velocity");
     64                        diagnostic_core(femmodel);
     65                }
    6166
    62                 _printf_(VerboseSolution(),"%s\n","   computing new thickness");
    63                 prognostic_core(femmodel);
     67                if(isprognostic){
     68                        _printf_(VerboseSolution(),"%s\n","   computing new thickness");
     69                        prognostic_core(femmodel);
     70                }
    6471
    6572                if (gl_migration!=NoneEnum){
  • issm/trunk/src/c/solutions/transient3d_core.cpp

    r7288 r8319  
    1818        double finaltime;
    1919        double dt,yts;
    20         bool control_analysis;
     20        bool   control_analysis,isdiagnostic,isprognostic,isthermal;
    2121        bool   time_adapt=false;
    2222        int    solution_type;
     
    3535        femmodel->parameters->FindParam(&output_frequency,OutputFrequencyEnum);
    3636        femmodel->parameters->FindParam(&time_adapt,TimeAdaptEnum);
     37        femmodel->parameters->FindParam(&isdiagnostic,IsDiagnosticEnum);
     38        femmodel->parameters->FindParam(&isprognostic,IsPrognosticEnum);
     39        femmodel->parameters->FindParam(&isthermal,IsThermalEnum);
    3740
    3841        /*initialize: */
     
    5356                _printf_(VerboseSolution(),"%s%g%s%i%s%g%s%g\n","time [yr]: ",time/yts,"    iteration number: ",step,"/",floor((finaltime-time)/dt)," dt [yr]: ",dt/yts);
    5457
    55                 _printf_(VerboseSolution(),"   computing temperatures:\n");
    56                 thermal_core_step(femmodel,step,time);
     58                if(isthermal){
     59                        _printf_(VerboseSolution(),"   computing temperatures:\n");
     60                        thermal_core_step(femmodel,step,time);
     61                }
    5762
     63                if(isdiagnostic){
    5864                _printf_(VerboseSolution(),"%s\n","   computing new velocity");
    5965                diagnostic_core(femmodel);
     66                }
    6067
    61                 _printf_(VerboseSolution(),"%s\n","   computing new thickness");
    62                 prognostic_core(femmodel);
    63        
    64                 _printf_(VerboseSolution(),"%s\n","   updating vertices positions");
    65                 UpdateVertexPositionsx(femmodel->elements, femmodel->nodes,femmodel->vertices,femmodel->loads, femmodel->materials, femmodel->parameters);
     68                if(isprognostic){
     69                        _printf_(VerboseSolution(),"%s\n","   computing new thickness");
     70                        prognostic_core(femmodel);
     71                        _printf_(VerboseSolution(),"%s\n","   updating vertices positions");
     72                        UpdateVertexPositionsx(femmodel->elements, femmodel->nodes,femmodel->vertices,femmodel->loads, femmodel->materials, femmodel->parameters);
     73                }
    6674
    6775                if(solution_type==Transient3DSolutionEnum && !control_analysis && (step%output_frequency==0 || time==finaltime)){
  • issm/trunk/src/m/classes/model.m

    r8316 r8319  
    211211                 hydrostatic_adjustment=0;
    212212
    213                  %Analysis
    214                  prognostic_analysis=0;
    215                  diagnostic_analysis=0;
    216                  thermal_analysis=0;
     213                 %Transient flags
     214                 isprognostic=0;
     215                 isdiagnostic=0;
     216                 isthermal=0;
    217217
    218218                 %Control
     
    657657                         %Solution activated for transient runs. By default we do a
    658658                         %full analysis: Diagnostic, Prognostic and Thermal
    659                          md.prognostic_analysis=1;
    660                          md.diagnostic_analysis=1;
    661                          md.thermal_analysis=1;
     659                         md.isprognostic=1;
     660                         md.isdiagnostic=1;
     661                         md.isthermal=1;
    662662
    663663                         %Control
  • issm/trunk/src/m/model/display/displaytransient.m

    r8309 r8319  
    1010
    1111disp('Transient parameters on a pure solution basis:');
    12 if md.diagnostic_analysis,
     12if md.isdiagnostic,
    1313        displaydiagnostic(md);
    1414else
    15         disp(sprintf('         %s','no scheduled diagnostic. activate by doing md.diagnostic_analysis=1'));
     15        disp(sprintf('         %s','no scheduled diagnostic. activate by doing md.isdiagnostic=1'));
    1616end
    17 if md.prognostic_analysis,
     17if md.isprognostic,
    1818        displayprognostic(md);
    1919else
    20         disp(sprintf('         %s','no scheduled prognostic. activate by doing md.prognostic_analysis=1'));
     20        disp(sprintf('         %s','no scheduled prognostic. activate by doing md.isprognostic=1'));
    2121end
    22 if md.thermal_analysis,
     22if md.isthermal,
    2323        displaythermal(md);
    2424else
    25         disp(sprintf('         %s','no scheduled thermal. activate by doing md.thermal_analysis=1'));
     25        disp(sprintf('         %s','no scheduled thermal. activate by doing md.isthermal=1'));
    2626end
    2727
  • issm/trunk/src/m/model/ismodelselfconsistent.m

    r8313 r8319  
    273273                error('model not consistent: field dt must be positive for a transient run')
    274274        end
    275 
    276275        if(md.cfl_coefficient>1 | md.cfl_coefficient<0),
    277276                error(['model not consistent: model ' md.name ' cfl_coefficient field should between  0 and 1']);
    278277        end
    279 
    280278        if(md.cfl_coefficient>1 | md.cfl_coefficient<0),
    281279                error(['model not consistent: model ' md.name ' cfl_coefficient field should between  0 and 1']);
     280        end
     281        if ~ismember(md.isdiagnostic,[0 1]),
     282                error('model not consistent: isdiagnostic should be a scalar (1 or 0)');
     283        end
     284        if ~ismember(md.isprognostic,[0 1]),
     285                error('model not consistent: isprognostic should be a scalar (1 or 0)');
     286        end
     287        if ~ismember(md.isthermal,[0 1]),
     288                error('model not consistent: isthermal should be a scalar (1 or 0)');
    282289        end
    283290
  • issm/trunk/src/m/model/marshall.m

    r8313 r8319  
    101101
    102102%Transient
    103 WriteData(fid,md.diagnostic_analysis,'Scalar','diagnostic_analysis');
    104 WriteData(fid,md.prognostic_analysis,'Scalar','prognostic_analysis');
    105 WriteData(fid,md.thermal_analysis,'Scalar','thermal_analysis');
     103WriteData(fid,md.isdiagnostic,'Integer','isdiagnostic');
     104WriteData(fid,md.isprognostic,'Integer','isprognostic');
     105WriteData(fid,md.isthermal,'Integer','isthermal');
    106106
    107107%Get materials
  • issm/trunk/src/m/solutions/transient2d_core.m

    r7808 r8319  
    1414        output_frequency=femmodel.parameters.OutputFrequency;
    1515        time_adapt=femmodel.parameters.TimeAdapt;
     16        isdiagnostic=femmodel.parameters.IsDiagnostic;
     17        isprognostic=femmodel.parameters.IsPrognostic;
     18        isthermal=femmodel.parameters.IsThermal;
    1619
    1720        %Initialize
     
    3336                issmprintf(VerboseSolution,'\n%s%g%s%i%s%g\n','time [yr]: ',time,' iteration number: ',step,'/',floor(ndt/dt));
    3437
    35                 issmprintf(VerboseSolution,'\n%s',['   computing new velocities']);
    36                 femmodel=diagnostic_core(femmodel);
     38                if (isdiagnostic)
     39                        issmprintf(VerboseSolution,'\n%s',['   computing new velocities']);
     40                        femmodel=diagnostic_core(femmodel);
     41                end
    3742
    38                 issmprintf(VerboseSolution,'\n%s',['   computing new thickness']);
    39                 femmodel=prognostic_core(femmodel);
     43                if (isprognostic)
     44                        issmprintf(VerboseSolution,'\n%s',['   computing new thickness']);
     45                        femmodel=prognostic_core(femmodel);
     46                end
    4047
    4148                if (solution_type==Transient2DSolutionEnum & ~control_analysis & (mod(step,output_frequency)==0 | time==ndt)),
  • issm/trunk/src/m/solutions/transient3d_core.m

    r7111 r8319  
    1313        output_frequency=femmodel.parameters.OutputFrequency;
    1414        time_adapt=femmodel.parameters.TimeAdapt;
     15        isdiagnostic=femmodel.parameters.IsDiagnostic;
     16        isprognostic=femmodel.parameters.IsPrognostic;
     17        isthermal=femmodel.parameters.IsThermal;
    1518
    1619        %Initialize
     
    3235                issmprintf(VerboseSolution,'\n%s%g%s%i%s%g\n','time [yr] ',time,' iteration number: ',step,'/',floor(ndt/dt));
    3336
    34                 issmprintf(VerboseSolution,'\n%s',['   computing temperature']);
    35                 femmodel=thermal_core_step(femmodel);
     37                if (isthermal)
     38                        issmprintf(VerboseSolution,'\n%s',['   computing temperature']);
     39                        femmodel=thermal_core_step(femmodel);
     40                end
    3641
    37                 issmprintf(VerboseSolution,'\n%s',['   computing new velocities']);
    38                 femmodel=diagnostic_core(femmodel);
     42                if (isdiagnostic)
     43                        issmprintf(VerboseSolution,'\n%s',['   computing new velocities']);
     44                        femmodel=diagnostic_core(femmodel);
     45                end
    3946
    40                 issmprintf(VerboseSolution,'\n%s',['   computing new thickness']);
    41                 femmodel=prognostic_core(femmodel);
    42 
    43                 issmprintf(VerboseSolution,'\n%s',['   updating vertices position']);
    44                 [femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters]=UpdateVertexPositions(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters);
     47                if (isprognostic)
     48                        issmprintf(VerboseSolution,'\n%s',['   computing new thickness']);
     49                        femmodel=prognostic_core(femmodel);
     50                        issmprintf(VerboseSolution,'\n%s',['   updating vertices position']);
     51                        [femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters]=...
     52                                UpdateVertexPositions(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters);
     53                end
    4554
    4655                if (solution_type==Transient3DSolutionEnum & ~control_analysis & (mod(step,output_frequency)==0 | time==ndt)),
Note: See TracChangeset for help on using the changeset viewer.