Changeset 24342


Ignore:
Timestamp:
11/16/19 23:01:19 (5 years ago)
Author:
Mathieu Morlighem
Message:

CHG: fixed DC

Location:
issm/trunk-jpl/src/c/classes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r24339 r24342  
    32673267                                if(xIsInf<IssmDouble>(values[i])) _error_("Inf found in vector");
    32683268                        }
    3269                         //this->inputs->AddInput(new TriaInput(name,values,this->element_type));
    3270                         _error_("not implemented");
     3269                        if(this->element_type==P1Enum){
     3270                                inputs2->SetTriaInput(name,P1Enum,NUMVERTICES,lidlist,values);
     3271                        }
     3272                        else{
     3273                                inputs2->SetTriaInput(name,this->element_type,this->lid,numnodes,values);
     3274                        }
    32713275                        break;
    32723276
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r24340 r24342  
    51415141
    51425142        for(int i=0;i<numoutputs;i++){
    5143                 if(transientinput_enum[i]<0){
    5144                         _error_("Can't deal with non enum fields for result Stack");
    5145                 }
    5146                 else{
    5147                         _error_("not implemented with inputs2");
    5148                         for(int j=0;j<elements->Size();j++){
    5149                                 /*Intermediaries*/
    5150                                 TransientInput* transient_input = new TransientInput(transientinput_enum[i]);
    5151                                 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(j));
    5152                                 element->inputs->AddInput(transient_input);
    5153                         }
    5154                 }
     5143                this->inputs2->DeleteInput(transientinput_enum[i]);
     5144                this->inputs2->SetTransientInput(transientinput_enum[i],NULL,0);
    51555145        }
    51565146}
     
    51655155                        for(int j=0;j<elements->Size();j++){
    51665156                                /*Intermediaries*/
     5157                                _error_("TODO");
    51675158                                Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(j));
    51685159                                Input* input=element->inputs->GetInput(transientinput_enum[i]); _assert_(input); //this is the enum stack
  • issm/trunk-jpl/src/c/classes/Inputs2/TransientInput2.cpp

    r24335 r24342  
    3737
    3838        /*Allocate values and timesteps, and copy: */
    39         _assert_(N>0 && N<1e6);
     39        _assert_(N>=0 && N<1e6);
    4040        this->numtimesteps=N;
    41         this->timesteps=xNew<IssmDouble>(N);
    42         xMemCpy(this->timesteps,timesin,N);
    43 
    44         this->inputs     = xNew<Input2*>(N);
    45         for(int i=0;i<N;i++) this->inputs[i] = NULL;
     41        if(N>0){
     42                this->timesteps=xNew<IssmDouble>(N);
     43                xMemCpy(this->timesteps,timesin,N);
     44
     45                this->inputs     = xNew<Input2*>(N);
     46                for(int i=0;i<N;i++) this->inputs[i] = NULL;
     47        }
     48        else{
     49                this->timesteps=0;
     50                this->inputs   =0;
     51        }
    4652        this->parameters = NULL;
    47 
    4853        this->current_input=NULL;
    4954        this->current_step=-1;
Note: See TracChangeset for help on using the changeset viewer.