Changeset 25531


Ignore:
Timestamp:
09/03/20 21:27:22 (5 years ago)
Author:
Mathieu Morlighem
Message:

CHG: better handling of some objects

Location:
issm/trunk-jpl/src/c
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h

    r25523 r25531  
    5858                        marshallhandle->call(object_enum);
    5959                        marshallhandle->call(this->id);
     60                        marshallhandle->call(this->result_name);
     61                        marshallhandle->call(this->M);
     62                        marshallhandle->call(this->N);
    6063                        marshallhandle->call(this->step);
    6164                        marshallhandle->call(this->time);
    62 
    63                         /*Marshal result name*/
    64                         int size = 0;
    65                         if(marshallhandle->OperationNumber()!=MARSHALLING_LOAD) size=strlen(result_name)+1;
    66                         marshallhandle->call(size);
    67                         marshallhandle->call(this->result_name,size);
    68 
    69                         /*Marshall value*/
    70                         this->value=0;
    71                         bool isnull=true;
    72                         if(marshallhandle->OperationNumber()!=MARSHALLING_LOAD){
    73                                 if(value) isnull=false;
    74                         }
    75                         marshallhandle->call(isnull);
    76                         if(!isnull){
    77                                 marshallhandle->call(this->value);
    78                         }
     65                        marshallhandle->call(this->value);
    7966                }  /*}}}*/
    8067
     
    257244} /*}}}*/
    258245template <> inline void GenericExternalResult<int>::Marshall(MarshallHandle* marshallhandle){/*{{{*/
    259         printf("-------------- file: GenericExternalResult.h line: %i\n",__LINE__);
    260246        this->GenericMarshall(marshallhandle);
    261247}  /*}}}*/
     
    276262} /*}}}*/
    277263template <> inline void GenericExternalResult<double>::Marshall(MarshallHandle* marshallhandle){/*{{{*/
    278         printf("-------------- file: GenericExternalResult.h line: %i\n",__LINE__);
    279264        this->GenericMarshall(marshallhandle);
    280265}  /*}}}*/
  • issm/trunk-jpl/src/c/classes/Params/GenericParam.h

    r25508 r25531  
    5353                // use the default copy constructor instead
    5454                                         void Marshall(MarshallHandle* marshallhandle){
    55                                                  _printf_("   WARNING: parameter "<<EnumToStringx(this->myEnumVal)<<" is a GenericParam and cannot be marshalled\n");
     55                                                 if(this->InstanceEnum()!=FemModelCommEnum){
     56                                                         _printf_("   WARNING: parameter "<<EnumToStringx(this->myEnumVal)<<" is a GenericParam and cannot be marshalled\n");
     57                                                 }
    5658                                                 /*Nothing for now*/
    5759                                         }
  • issm/trunk-jpl/src/c/datastructures/DataSet.cpp

    r25528 r25531  
    241241                                _printf_("   WARNING: Could not load GenericExternalResult, need overload\n");
    242242                        }
     243                        else if(obj_enum==IntExternalResultEnum){
     244                                GenericExternalResult<int>* res=new GenericExternalResult<int>();
     245                                res->Marshall(marshallhandle);
     246                                this->AddObject(res);
     247                        }
     248                        else if(obj_enum==DoubleExternalResultEnum){
     249                                GenericExternalResult<double>* res=new GenericExternalResult<double>();
     250                                res->Marshall(marshallhandle);
     251                                this->AddObject(res);
     252                        }
    243253                        else _error_("could not recognize enum type: " << obj_enum << ": " << EnumToStringx(obj_enum) );
    244254                }
  • issm/trunk-jpl/src/c/solutionsequences/solutionsequence_nonlinear.cpp

    r24681 r25531  
    104104                count++;
    105105                if(converged==true){
    106                         femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,StressbalanceConvergenceNumStepsEnum,count));
     106                        femmodel->results->AddResult(new GenericExternalResult<int>(femmodel->results->Size()+1,StressbalanceConvergenceNumStepsEnum,count));
    107107                        break;
    108108                }
     
    110110                        _printf0_("   maximum number of nonlinear iterations (" << max_nonlinear_iterations << ") exceeded\n");
    111111                        converged=true;
    112                         femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,StressbalanceConvergenceNumStepsEnum,max_nonlinear_iterations));
     112                        femmodel->results->AddResult(new GenericExternalResult<int>(femmodel->results->Size()+1,StressbalanceConvergenceNumStepsEnum,max_nonlinear_iterations));
    113113                        InputUpdateFromConstantx(femmodel,converged,ConvergedEnum);
    114114                        InputUpdateFromSolutionx(femmodel,ug);         
Note: See TracChangeset for help on using the changeset viewer.