Changeset 4050


Ignore:
Timestamp:
06/17/10 11:06:40 (15 years ago)
Author:
Eric.Larour
Message:

Split results between element results and external results.
element results are held in the Results* dataset of each element.
external results are held in the femmodel->Results* dataset, and hold anything that cannot fit in the elements.

Location:
issm/trunk/src/c/objects
Files:
29 added
1 deleted
30 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Elements/Beam.cpp

    r4048 r4050  
    10021002}
    10031003/*}}}*/
    1004 /*FUNCTION Beam::AXPY(int YEnum, double scalar, int XEnum);{{{1*/
    1005 void  Beam::AXPY(int YEnum, double scalar, int XEnum){
     1004/*FUNCTION Beam::AXPYInput(int YEnum, double scalar, int XEnum);{{{1*/
     1005void  Beam::AXPYInput(int YEnum, double scalar, int XEnum){
    10061006
    10071007        Input* xinput=NULL;
     
    10201020}
    10211021/*}}}*/
    1022 /*FUNCTION Beam::ControlConstrain(int control_type, double cm_min, double cm_max){{{1*/
    1023 void  Beam::ControlConstrain(int control_type, double cm_min, double cm_max){
     1022/*FUNCTION Beam::ControlConstrainInput(int control_type, double cm_min, double cm_max){{{1*/
     1023void  Beam::ControlConstrainInput(int control_type, double cm_min, double cm_max){
    10241024
    10251025        Input* input=NULL;
     
    10391039void  Beam::GetVectorFromInputs(Vec vector,int NameEnum){
    10401040
     1041        int i;
    10411042        const int numvertices=2;
    10421043        int doflist1[numvertices];
     
    10451046        for(i=0;i<this->inputs->Size();i++){
    10461047                Input* input=(Input*)this->inputs->GetObjectByOffset(i);
    1047                 if(input->EnumType==NameEnum){
     1048                if(input->EnumType()==NameEnum){
    10481049                        /*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
    10491050                        this->GetDofList1(&doflist1[0]);
  • issm/trunk/src/c/objects/Elements/Beam.h

    r4048 r4050  
    9696                void  DuplicateInput(int original_enum,int new_enum);
    9797                void  ScaleInput(int enum_type,double scale_factor);
    98                 void  AXPY(int YEnum, double scalar, int XEnum);
    99                 void  ControlConstrain(int control_type,double cm_min, double cm_max);
     98                void  AXPYInput(int YEnum, double scalar, int XEnum);
     99                void  ControlConstrainInput(int control_type,double cm_min, double cm_max);
    100100
    101101                /*}}}*/
  • issm/trunk/src/c/objects/Elements/Element.h

    r4048 r4050  
    6767                virtual void   ScaleInput(int enum_type,double scale_factor)=0;
    6868                virtual void   GetVectorFromInputs(Vec vector,int NameEnum)=0;
    69                 virtual void   AXPY(int YEnum, double scalar, int XEnum)=0;
    70                 virtual void   ControlConstrain(int control_type,double cm_min, double cm_max)=0;
     69                virtual void   AXPYInput(int YEnum, double scalar, int XEnum)=0;
     70                virtual void   ControlConstrainInput(int control_type,double cm_min, double cm_max)=0;
    7171                /*Implementation: */
    7272
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r4048 r4050  
    616616
    617617        for(i=0;i<this->results->Size();i++){
    618                 Result* result=(Result*)this->results->GetObjectByOffset(i);
    619                 result->ProcessUnits(this->parameters);
     618                ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
     619                elementresult->ProcessUnits(this->parameters);
    620620        }
    621621
     
    45784578void  Penta::GradjDrag(void){
    45794579
     4580        int i;
    45804581        Tria* tria=NULL;
    45814582        TriaVertexInput* triavertexinput=NULL;
     
    46214622
    46224623        /*Now, the tria  has a GradientEnum input. Take it, and make a PentaVertexInput out of it, then delete the tria: */
    4623         triavertexinput=tria->inputs->GetInput(GradientEnum);
     4624        triavertexinput=(TriaVertexInput*)tria->inputs->GetInput(GradientEnum);
    46244625        for(i=0;i<3;i++)gradient[i]=triavertexinput->values[i];
    46254626        this->inputs->AddInput(new PentaVertexInput(GradientEnum,&gradient[0]));
     
    46324633void  Penta::GradjB(void){
    46334634
     4635        int i;
    46344636        Tria* tria=NULL;
    46354637        TriaVertexInput* triavertexinput=NULL;
     
    46654667       
    46664668        /*Now, the tria  has a GradientEnum input. Take it, and make a PentaVertexInput out of it, then delete the tria: */
    4667         triavertexinput=tria->inputs->GetInput(GradientEnum);
     4669        triavertexinput=(TriaVertexInput*)tria->inputs->GetInput(GradientEnum);
    46684670        for(i=0;i<3;i++)gradient[i]=triavertexinput->values[i];
    46694671        this->inputs->AddInput(new PentaVertexInput(GradientEnum,&gradient[0]));
     
    49594961        /*Go through all the results objects, and update the counters: */
    49604962        for (i=0;i<this->results->Size();i++){
    4961                 Result* result=(Result*)this->results->GetObjectByOffset(i);
     4963                ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
    49624964                /*first, we have one more result: */
    49634965                numrows++;
    49644966                /*now, how many vertices and how many nodal values for this result? :*/
    49654967                numvertices=6; //this is a penta element, with 6 vertices
    4966                 numnodes=result->NumberOfNodalValues(); //ask result object.
     4968                numnodes=elementresult->NumberOfNodalValues(); //ask result object.
    49674969        }
    49684970
     
    49894991
    49904992        for(i=0;i<this->results->Size();i++){
    4991                 Result* result=(Result*)this->results->GetObjectByOffset(i);
     4993                ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
    49924994
    49934995                /*For this result,fill the information in the Patch object (element id + vertices ids), and then hand
    49944996                 *it to the result object, to fill the rest: */
    49954997                patch->fillelementinfo(count,this->id,vertices_ids,6);
    4996                 result->PatchFill(count,patch);
     4998                elementresult->PatchFill(count,patch);
    49974999
    49985000                /*increment counter: */
     
    53525354}
    53535355/*}}}*/
    5354 /*FUNCTION Penta::AXPY(int YEnum, double scalar, int XEnum);{{{1*/
    5355 void  Penta::AXPY(int YEnum, double scalar, int XEnum){
     5356/*FUNCTION Penta::AXPYInput(int YEnum, double scalar, int XEnum);{{{1*/
     5357void  Penta::AXPYInput(int YEnum, double scalar, int XEnum){
    53565358
    53575359        Input* xinput=NULL;
     
    53705372}
    53715373/*}}}*/
    5372 /*FUNCTION Penta::ControlConstrain(int control_type, double cm_min, double cm_max){{{1*/
    5373 void  Penta::ControlConstrain(int control_type, double cm_min, double cm_max){
     5374/*FUNCTION Penta::ControlConstrainInput(int control_type, double cm_min, double cm_max){{{1*/
     5375void  Penta::ControlConstrainInput(int control_type, double cm_min, double cm_max){
    53745376
    53755377        Input* input=NULL;
     
    53895391void  Penta::GetVectorFromInputs(Vec vector,int NameEnum){
    53905392
     5393        int i;
    53915394        const int numvertices=6;
    53925395        int doflist1[numvertices];
     
    53955398        for(i=0;i<this->inputs->Size();i++){
    53965399                Input* input=(Input*)this->inputs->GetObjectByOffset(i);
    5397                 if(input->EnumType==NameEnum){
     5400                if(input->EnumType()==NameEnum){
    53985401                        /*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
    53995402                        this->GetDofList1(&doflist1[0]);
  • issm/trunk/src/c/objects/Elements/Penta.h

    r4048 r4050  
    163163                void  DuplicateInput(int original_enum,int new_enum);
    164164                void  ScaleInput(int enum_type,double scale_factor);
    165                 void  AXPY(int YEnum, double scalar, int XEnum);
    166                 void  ControlConstrain(int control_type,double cm_min, double cm_max);
     165                void  AXPYInput(int YEnum, double scalar, int XEnum);
     166                void  ControlConstrainInput(int control_type,double cm_min, double cm_max);
    167167                void  GetVectorFromInputs(Vec vector,int NameEnum);
    168168
  • issm/trunk/src/c/objects/Elements/Sing.cpp

    r4048 r4050  
    708708}
    709709/*}}}*/
    710 /*FUNCTION Sing::AXPY(int YEnum, double scalar, int XEnum);{{{1*/
    711 void  Sing::AXPY(int YEnum, double scalar, int XEnum){
     710/*FUNCTION Sing::AXPYInput(int YEnum, double scalar, int XEnum);{{{1*/
     711void  Sing::AXPYInput(int YEnum, double scalar, int XEnum){
    712712
    713713        Input* xinput=NULL;
     
    726726}
    727727/*}}}*/
    728 /*FUNCTION Sing::ControlConstrain(int control_type, double cm_min, double cm_max){{{1*/
    729 void  Sing::ControlConstrain(int control_type, double cm_min, double cm_max){
     728/*FUNCTION Sing::ControlConstrainInput(int control_type, double cm_min, double cm_max){{{1*/
     729void  Sing::ControlConstrainInput(int control_type, double cm_min, double cm_max){
    730730
    731731        Input* input=NULL;
     
    745745void  Sing::GetVectorFromInputs(Vec vector,int NameEnum){
    746746
     747        int i;
    747748        const int numvertices=1;
    748749        int doflist1[numvertices];
     
    751752        for(i=0;i<this->inputs->Size();i++){
    752753                Input* input=(Input*)this->inputs->GetObjectByOffset(i);
    753                 if(input->EnumType==NameEnum){
     754                if(input->EnumType()==NameEnum){
    754755                        /*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
    755756                        this->GetDofList1(&doflist1[0]);
  • issm/trunk/src/c/objects/Elements/Sing.h

    r4048 r4050  
    9595                void  DuplicateInput(int original_enum,int new_enum);
    9696                void  ScaleInput(int enum_type,double scale_factor);
    97                 void  AXPY(int YEnum, double scalar, int XEnum);
    98                 void  ControlConstrain(int control_type,double cm_min, double cm_max);
     97                void  AXPYInput(int YEnum, double scalar, int XEnum);
     98                void  ControlConstrainInput(int control_type,double cm_min, double cm_max);
    9999
    100100
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r4048 r4050  
    512512
    513513        for(i=0;i<this->results->Size();i++){
    514                 Result* result=(Result*)this->results->GetObjectByOffset(i);
    515                 result->ProcessUnits(this->parameters);
     514                ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
     515                elementresult->ProcessUnits(this->parameters);
    516516        }
    517517
     
    43084308/*}}}*/
    43094309/*FUNCTION Tria::GradjDragStokes {{{1*/
    4310 void  Tria::GradjDragStokes(Vec grad_g){
     4310void  Tria::GradjDragStokes(void){
    43114311
    43124312        int i;
     
    44784478/*}}}*/
    44794479/*FUNCTION Tria::GradjB{{{1*/
    4480 void  Tria::GradjB(Vec grad_g){
     4480void  Tria::GradjB(void){
    44814481
    44824482        int i;
     
    50575057        /*Go through all the results objects, and update the counters: */
    50585058        for (i=0;i<this->results->Size();i++){
    5059                 Result* result=(Result*)this->results->GetObjectByOffset(i);
     5059                ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
    50605060                /*first, we have one more result: */
    50615061                numrows++;
    50625062                /*now, how many vertices and how many nodal values for this result? :*/
    50635063                numvertices=3; //this is a tria element, with 3 vertices
    5064                 numnodes=result->NumberOfNodalValues(); //ask result object.
     5064                numnodes=elementresult->NumberOfNodalValues(); //ask result object.
    50655065        }
    50665066
     
    50875087
    50885088        for(i=0;i<this->results->Size();i++){
    5089                 Result* result=(Result*)this->results->GetObjectByOffset(i);
     5089                ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
    50905090
    50915091                /*For this result,fill the information in the Patch object (element id + vertices ids), and then hand
    50925092                 *it to the result object, to fill the rest: */
    50935093                patch->fillelementinfo(row,this->id,vertices_ids,3);
    5094                 result->PatchFill(row,patch);
     5094                elementresult->PatchFill(row,patch);
    50955095
    50965096                /*increment rower: */
     
    54505450}
    54515451/*}}}*/
    5452 /*FUNCTION Tria::AXPY(int YEnum, double scalar, int XEnum);{{{1*/
    5453 void  Tria::AXPY(int YEnum, double scalar, int XEnum){
     5452/*FUNCTION Tria::AXPYInput(int YEnum, double scalar, int XEnum);{{{1*/
     5453void  Tria::AXPYInput(int YEnum, double scalar, int XEnum){
    54545454
    54555455        Input* xinput=NULL;
     
    54685468}
    54695469/*}}}*/
    5470 /*FUNCTION Tria::ControlConstrain(int control_type, double cm_min, double cm_max){{{1*/
    5471 void  Tria::ControlConstrain(int control_type, double cm_min, double cm_max){
     5470/*FUNCTION Tria::ControlConstrainInput(int control_type, double cm_min, double cm_max){{{1*/
     5471void  Tria::ControlConstrainInput(int control_type, double cm_min, double cm_max){
    54725472
    54735473        Input* input=NULL;
     
    54875487void  Tria::GetVectorFromInputs(Vec vector,int NameEnum){
    54885488
     5489        int i;
    54895490        const int numvertices=3;
    54905491        int doflist1[numvertices];
     
    54935494        for(i=0;i<this->inputs->Size();i++){
    54945495                Input* input=(Input*)this->inputs->GetObjectByOffset(i);
    5495                 if(input->EnumType==NameEnum){
     5496                if(input->EnumType()==NameEnum){
    54965497                        /*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
    54975498                        this->GetDofList1(&doflist1[0]);
  • issm/trunk/src/c/objects/Elements/Tria.h

    r4048 r4050  
    141141                void  DuplicateInput(int original_enum,int new_enum);
    142142                void  ScaleInput(int enum_type,double scale_factor);
    143                 void  AXPY(int YEnum, double scalar, int XEnum);
    144                 void  ControlConstrain(int control_type,double cm_min, double cm_max);
     143                void  AXPYInput(int YEnum, double scalar, int XEnum);
     144                void  ControlConstrainInput(int control_type,double cm_min, double cm_max);
    145145                void  GetVectorFromInputs(Vec vector,int NameEnum);
    146146
  • issm/trunk/src/c/objects/FemModel.cpp

    r4034 r4050  
    3131        this->solution_type=in_solution_type;
    3232        analysis_counter=nummodels-1; //point to last analysis_type carried out.
     33        this->results=new DataSet(); //not initialized by CreateDataSets
    3334       
    3435        /*Dynamically allocate whatever is a list of length nummodels: */
     
    100101        delete materials;
    101102        delete parameters;
     103        delete results;
    102104        delete partition;
    103105        delete tpartition;
  • issm/trunk/src/c/objects/FemModel.h

    r4028 r4050  
    3535                DataSet*            materials;  //one set of materials, for each element
    3636                Parameters*         parameters; //one set of parameters, independent of the analysis_type
     37                DataSet*            results; //results that cannot be fit into the elements (such as one time constants, arrays, strings, etc ...)
    3738
    3839                DofVec*             partition; //one partitioning for all elements
  • issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp

    r4048 r4050  
    167167/*}}}*/
    168168/*FUNCTION BeamVertexInput::SpawnResult{{{1*/
    169 Result* BeamVertexInput::SpawnResult(int step, double time){
    170 
    171         return new BeamVertexResult(this->enum_type,this->values,step,time);
     169ElementResult* BeamVertexInput::SpawnResult(int step, double time){
     170
     171        return new BeamVertexElementResult(this->enum_type,this->values,step,time);
    172172
    173173}
     
    267267
    268268        /*xinput is of the same type, so cast it: */
    269         xbeamvertexinput=(BeamVertexInput)xinput;
     269        xbeamvertexinput=(BeamVertexInput*)xinput;
    270270
    271271        /*Carry out the AXPY operation:*/
  • issm/trunk/src/c/objects/Inputs/BeamVertexInput.h

    r4048 r4050  
    4848                Input* SpawnBeamInput(int* indices);
    4949                Input* SpawnTriaInput(int* indices);
    50                 Result* SpawnResult(int step, double time);
     50                ElementResult* SpawnResult(int step, double time);
    5151
    5252                /*}}}*/
  • issm/trunk/src/c/objects/Inputs/BoolInput.cpp

    r4048 r4050  
    175175/*}}}*/
    176176/*FUNCTION BoolInput::SpawnResult{{{1*/
    177 Result* BoolInput::SpawnResult(int step, double time){
     177ElementResult* BoolInput::SpawnResult(int step, double time){
    178178
    179179        ISSMERROR(" not supported yet!");
     
    234234
    235235        /*xinput is of the same type, so cast it: */
    236         xboolinput=(BoolInput)xinput;
     236        xboolinput=(BoolInput*)xinput;
    237237
    238238        /*Carry out the AXPY operation:*/
  • issm/trunk/src/c/objects/Inputs/BoolInput.h

    r4048 r4050  
    4848                Input* SpawnBeamInput(int* indices);
    4949                Input* SpawnTriaInput(int* indices);
    50                 Result* SpawnResult(int step, double time);
     50                ElementResult* SpawnResult(int step, double time);
    5151
    5252                /*}}}*/
  • issm/trunk/src/c/objects/Inputs/DoubleInput.cpp

    r4048 r4050  
    175175/*}}}*/
    176176/*FUNCTION DoubleInput::SpawnResult{{{1*/
    177 Result* DoubleInput::SpawnResult(int step, double time){
    178 
    179         return new DoubleResult(this->enum_type,this->value,step,time);
     177ElementResult* DoubleInput::SpawnResult(int step, double time){
     178
     179        return new DoubleElementResult(this->enum_type,this->value,step,time);
    180180
    181181}
     
    245245
    246246        /*xinput is of the same type, so cast it: */
    247         xdoubleinput=(DoubleInput)xinput;
     247        xdoubleinput=(DoubleInput*)xinput;
    248248
    249249        /*Carry out the AXPY operation:*/
  • issm/trunk/src/c/objects/Inputs/DoubleInput.h

    r4048 r4050  
    4949                Input* SpawnBeamInput(int* indices);
    5050                Input* SpawnTriaInput(int* indices);
    51                 Result* SpawnResult(int step, double time);
     51                ElementResult* SpawnResult(int step, double time);
    5252
    5353                /*}}}*/
  • issm/trunk/src/c/objects/Inputs/Input.h

    r4048 r4050  
    1111#include "../Object.h"
    1212class Node;
    13 class Result;
     13class ElementResult;
    1414#include "../Node.h"
    1515/*}}}*/
     
    4949                virtual Input* SpawnBeamInput(int* indices)=0;
    5050                virtual Input* SpawnTriaInput(int* indices)=0;
    51                 virtual Result* SpawnResult(int step, double time)=0;
     51                virtual ElementResult* SpawnResult(int step, double time)=0;
    5252                virtual void SquareMin(double* psquaremin, bool process_units,Parameters* parameters)=0;
    5353                virtual void Scale(double scale_factor)=0;
  • issm/trunk/src/c/objects/Inputs/IntInput.cpp

    r4048 r4050  
    172172/*}}}*/
    173173/*FUNCTION IntInput::SpawnResult{{{1*/
    174 Result* IntInput::SpawnResult(int step, double time){
     174ElementResult* IntInput::SpawnResult(int step, double time){
    175175       
    176176        ISSMERROR(" not supported yet!");
     
    223223/*FUNCTION IntInput::Scale(double scale_factor){{{1*/
    224224void IntInput::Scale(double scale_factor){
    225         value=value*scale_factor;
     225        double dvalue=(double)value*scale_factor;
     226        value=(int)dvalue;
    226227}
    227228/*}}}*/
    228229/*FUNCTION IntInput::AXPY(Input* xinput,int scalar);{{{1*/
    229 void IntInput::AXPY(Input* xinput,int scalar){
    230 
     230void IntInput::AXPY(Input* xinput,double scalar){
     231
     232        double dvalue;
    231233        IntInput*  xintinput=NULL;
    232234
    233235        /*xinput is of the same type, so cast it: */
    234         xintinput=(IntInput)xinput;
     236        xintinput=(IntInput*)xinput;
    235237
    236238        /*Carry out the AXPY operation:*/
    237         this->value=this->value+scalar*xintinput->value;
     239        dvalue=(double)this->value+scalar*(double)xintinput->value;
     240        this->value=(int)dvalue;
    238241
    239242}
     
    242245void IntInput::Constrain(double cm_min, double cm_max){
    243246
    244         if(!isnan(cm_min)) if (this->value<cm_min)this->value=cm_min;
    245         if(!isnan(cm_max)) if (this->value>cm_max)this->value=cm_max;
     247        if(!isnan(cm_min)) if (this->value<cm_min)this->value=(int)cm_min;
     248        if(!isnan(cm_max)) if (this->value>cm_max)this->value=(int)cm_max;
    246249
    247250}
  • issm/trunk/src/c/objects/Inputs/IntInput.h

    r4048 r4050  
    4848                Input* SpawnBeamInput(int* indices);
    4949                Input* SpawnTriaInput(int* indices);
    50                 Result* SpawnResult(int step, double time);
     50                ElementResult* SpawnResult(int step, double time);
    5151
    5252                /*}}}*/
  • issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp

    r4048 r4050  
    200200/*}}}*/
    201201/*FUNCTION PentaVertexInput::SpawnResult{{{1*/
    202 Result* PentaVertexInput::SpawnResult(int step, double time){
    203 
    204         return new PentaVertexResult(this->enum_type,this->values,step,time);
     202ElementResult* PentaVertexInput::SpawnResult(int step, double time){
     203
     204        return new PentaVertexElementResult(this->enum_type,this->values,step,time);
    205205
    206206}
     
    916916
    917917        /*xinput is of the same type, so cast it: */
    918         xpentavertexinput=(PentaVertexInput)xinput;
     918        xpentavertexinput=(PentaVertexInput*)xinput;
    919919
    920920        /*Carry out the AXPY operation:*/
  • issm/trunk/src/c/objects/Inputs/PentaVertexInput.h

    r4048 r4050  
    4747                Input* SpawnBeamInput(int* indices);
    4848                Input* SpawnTriaInput(int* indices);
    49                 Result* SpawnResult(int step, double time);
     49                ElementResult* SpawnResult(int step, double time);
    5050
    5151                /*}}}*/
  • issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp

    r4048 r4050  
    158158/*}}}*/
    159159/*FUNCTION SingVertexInput::SpawnResult{{{1*/
    160 Result* SingVertexInput::SpawnResult(int step, double time){
    161 
    162         return new SingVertexResult(this->enum_type,this->value,step,time);
     160ElementResult* SingVertexInput::SpawnResult(int step, double time){
     161
     162        return new SingVertexElementResult(this->enum_type,this->value,step,time);
    163163
    164164}
     
    235235
    236236        /*xinput is of the same type, so cast it: */
    237         xsingvertexinput=(SingVertexInput)xinput;
     237        xsingvertexinput=(SingVertexInput*)xinput;
    238238
    239239        /*Carry out the AXPY operation:*/
    240         this->value=this->value+scalar*xngvertexinput->value;
     240        this->value=this->value+scalar*xsingvertexinput->value;
    241241
    242242}
  • issm/trunk/src/c/objects/Inputs/SingVertexInput.h

    r4048 r4050  
    4747                Input* SpawnBeamInput(int* indices);
    4848                Input* SpawnTriaInput(int* indices);
    49                 Result* SpawnResult(int step, double time);
     49                ElementResult* SpawnResult(int step, double time);
    5050
    5151                /*}}}*/
  • issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp

    r4048 r4050  
    186186/*}}}*/
    187187/*FUNCTION TriaVertexInput::SpawnResult{{{1*/
    188 Result* TriaVertexInput::SpawnResult(int step, double time){
    189 
    190         return new TriaVertexResult(this->enum_type,this->values,step,time);
     188ElementResult* TriaVertexInput::SpawnResult(int step, double time){
     189
     190        return new TriaVertexElementResult(this->enum_type,this->values,step,time);
    191191
    192192}
     
    490490
    491491        /*xinput is of the same type, so cast it: */
    492         xtriavertexinput=(TriaVertexInput)xinput;
     492        xtriavertexinput=(TriaVertexInput*)xinput;
    493493
    494494        /*Carry out the AXPY operation:*/
  • issm/trunk/src/c/objects/Inputs/TriaVertexInput.h

    r4048 r4050  
    4747                Input* SpawnBeamInput(int* indices);
    4848                Input* SpawnTriaInput(int* indices);
    49                 Result* SpawnResult(int step, double time);
     49                ElementResult* SpawnResult(int step, double time);
    5050
    5151                /*}}}*/
  • issm/trunk/src/c/objects/Loads/Pengrid.cpp

    r4043 r4050  
    466466        parameters->FindParam(&penalty_offset,PenaltyOffsetEnum);
    467467
    468         //Create elementary matrix: add penalty to contrain wb (wb=ub*db/dx+vb*db/dy)
     468        //Create elementary matrix: add penalty to constrain wb (wb=ub*db/dx+vb*db/dy)
    469469        Ke[2][0]=-slope[0]*kmax*pow((double)10.0,penalty_offset);
    470470        Ke[2][1]=-slope[1]*kmax*pow((double)10.0,penalty_offset);
  • issm/trunk/src/c/objects/Params/DoubleVecParam.cpp

    r3834 r4050  
    2626}
    2727/*}}}*/
    28 /*FUNCTION DoubleVecParam::DoubleVecParam(int enum_type,IssmDoubleVec value,int M){{{1*/
    29 DoubleVecParam::DoubleVecParam(int in_enum_type,double* in_value, int in_M){
     28/*FUNCTION DoubleVecParam::DoubleVecParam(int enum_type,IssmDoubleVec values,int M){{{1*/
     29DoubleVecParam::DoubleVecParam(int in_enum_type,double* in_values, int in_M){
    3030
    3131        enum_type=in_enum_type;
    3232        M=in_M;
    3333
    34         value=(double*)xmalloc(M*sizeof(double));
    35         memcpy(value,in_value,M*sizeof(double));
     34        values=(double*)xmalloc(M*sizeof(double));
     35        memcpy(values,in_values,M*sizeof(double));
    3636}
    3737/*}}}*/
    3838/*FUNCTION DoubleVecParam::~DoubleVecParam(){{{1*/
    3939DoubleVecParam::~DoubleVecParam(){
    40         xfree((void**)&value);
     40        xfree((void**)&values);
    4141        return;
    4242}
     
    4747Object* DoubleVecParam::copy() {
    4848       
    49         return new DoubleVecParam(this->enum_type,this->value,this->M);
     49        return new DoubleVecParam(this->enum_type,this->values,this->M);
    5050
    5151}
     
    6060        printf("   vector size: %i\n",this->M);
    6161        for(i=0;i<this->M;i++){
    62                 printf("%i %g\n",i,this->value[i]);
     62                printf("%i %g\n",i,this->values[i]);
    6363        }
    6464}
     
    7979        /*data: */
    8080        memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    81         value=(double*)xmalloc(M*sizeof(double));
    82         memcpy(value,marshalled_dataset,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
     81        values=(double*)xmalloc(M*sizeof(double));
     82        memcpy(values,marshalled_dataset,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
    8383
    8484        /*return: */
     
    124124        memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    125125        memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    126         memcpy(marshalled_dataset,value,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
     126        memcpy(marshalled_dataset,values,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
    127127
    128128        *pmarshalled_dataset=marshalled_dataset;
     
    152152        M=this->M;
    153153        output=(double*)xmalloc(M*sizeof(double));
    154         memcpy(output,value,M*sizeof(double));
     154        memcpy(output,values,M*sizeof(double));
    155155
    156156        /*Assign output pointers:*/
     
    168168
    169169        int i;
    170         double* newvalue=NULL;
     170        double* newvalues=NULL;
    171171
    172172        /*This param holds a vector of size numberofvertices, which means we are being asked to
     
    175175        if(this->M==numberofvertices){
    176176
    177                 newvalue=(double*)xmalloc(this->M*sizeof(double));
     177                newvalues=(double*)xmalloc(this->M*sizeof(double));
    178178                               
    179179                for(i=0;i<this->M;i++){
    180                         newvalue[(int)(partition[i])]=this->value[i];
     180                        newvalues[(int)(partition[i])]=this->values[i];
    181181                }
    182182
    183                 /*Reassign value to new value: */
    184                 xfree((void**)&this->value);
    185                 this->value=newvalue;
     183                /*Reassign values to new values: */
     184                xfree((void**)&this->values);
     185                this->values=newvalues;
    186186        }
    187187
  • issm/trunk/src/c/objects/Params/DoubleVecParam.h

    r4043 r4050  
    3131
    3232        private:
    33                 /*just hold 3 values for 3 vertices: */
    3433                int enum_type;
    35                 IssmDouble* value;
     34                IssmDouble* values;
    3635                int M;
    3736
     
    3938                /*constructors, destructors: {{{1*/
    4039                DoubleVecParam();
    41                 DoubleVecParam(int enum_type,IssmDouble* value,int M);
     40                DoubleVecParam(int enum_type,IssmDouble* values,int M);
    4241                ~DoubleVecParam();
    4342                /*}}}*/
  • issm/trunk/src/c/objects/objects.h

    r4043 r4050  
    5050#include "./Inputs/TriaVertexInput.h"
    5151
    52 /*Results: */
    53 #include "./Results/Result.h"
    54 #include "./Results/DoubleResult.h"
    55 #include "./Results/TriaVertexResult.h"
    56 #include "./Results/PentaVertexResult.h"
    57 #include "./Results/SingVertexResult.h"
    58 #include "./Results/BeamVertexResult.h"
     52/*ElementResults: */
     53#include "./ElementResults/ElementResult.h"
     54#include "./ElementResults/DoubleElementResult.h"
     55#include "./ElementResults/TriaVertexElementResult.h"
     56#include "./ElementResults/PentaVertexElementResult.h"
     57#include "./ElementResults/SingVertexElementResult.h"
     58#include "./ElementResults/BeamVertexElementResult.h"
     59
     60/*ExternalResults: */
     61#include "./ExternalResults/ExternalResult.h"
     62#include "./ExternalResults/BoolExternalResult.h"
     63#include "./ExternalResults/DoubleExternalResult.h"
     64#include "./ExternalResults/DoubleVecExternalResult.h"
     65#include "./ExternalResults/IntExternalResult.h"
     66#include "./ExternalResults/PetscVecExternalResult.h"
     67#include "./ExternalResults/StringExternalResult.h"
    5968
    6069/*Materials: */
Note: See TracChangeset for help on using the changeset viewer.