Changeset 8376


Ignore:
Timestamp:
05/20/11 13:22:48 (14 years ago)
Author:
Mathieu Morlighem
Message:

trunk: added PentaVertexInputs

Location:
issm/trunk/src/c
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/Container/Parameters.cpp

    r8263 r8376  
    5757/*}}}*/
    5858/*FUNCTION Parameters::FindParam(bool* pbool,int enum_type){{{1*/
    59 void Parameters::FindParam(bool* pbool,int enum_type){
     59void Parameters::FindParam(bool* pbool,int enum_type){ _assert_(this);
    6060       
    6161        vector<Object*>::iterator object;
     
    7474/*}}}*/
    7575/*FUNCTION Parameters::FindParam(int* pinteger,int enum_type){{{1*/
    76 void Parameters::FindParam(int* pinteger,int enum_type){
     76void Parameters::FindParam(int* pinteger,int enum_type){ _assert_(this);
    7777       
    7878        vector<Object*>::iterator object;
     
    9191/*}}}*/
    9292/*FUNCTION Parameters::FindParam(double* pscalar, int enum_type){{{1*/
    93 void Parameters::FindParam(double* pscalar, int enum_type){
     93void Parameters::FindParam(double* pscalar, int enum_type){ _assert_(this);
    9494       
    9595        vector<Object*>::iterator object;
     
    108108/*}}}*/
    109109/*FUNCTION Parameters::FindParam(char** pstring,int enum_type){{{1*/
    110 void Parameters::FindParam(char** pstring,int enum_type){
     110void Parameters::FindParam(char** pstring,int enum_type){ _assert_(this);
    111111       
    112112        vector<Object*>::iterator object;
     
    126126/*}}}*/
    127127/*FUNCTION Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){{{1*/
    128 void Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){
     128void Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){ _assert_(this);
    129129       
    130130        vector<Object*>::iterator object;
     
    144144/*}}}*/
    145145/*FUNCTION Parameters::FindParam(int** pintarray,int* pM,int enum_type){{{1*/
    146 void Parameters::FindParam(int** pintarray,int* pM, int enum_type){
     146void Parameters::FindParam(int** pintarray,int* pM, int enum_type){ _assert_(this);
    147147
    148148        vector<Object*>::iterator object;
     
    162162/*}}}*/
    163163/*FUNCTION Parameters::FindParam(double** pdoublearray,int* pM,int enum_type){{{1*/
    164 void Parameters::FindParam(double** pdoublearray,int* pM, int enum_type){
     164void Parameters::FindParam(double** pdoublearray,int* pM, int enum_type){ _assert_(this);
    165165
    166166        vector<Object*>::iterator object;
     
    180180/*}}}*/
    181181/*FUNCTION Parameters::FindParam(double** pdoublearray,int* pM, int* pN,int enum_type){{{1*/
    182 void Parameters::FindParam(double** pdoublearray,int* pM, int* pN,int enum_type){
     182void Parameters::FindParam(double** pdoublearray,int* pM, int* pN,int enum_type){ _assert_(this);
    183183
    184184        vector<Object*>::iterator object;
     
    198198/*}}}*/
    199199/*FUNCTION Parameters::FindParam(double*** parray,int* pM,int** pmdims_array,int** pndims_array,int enum_type){{{1*/
    200 void Parameters::FindParam(double*** parray,int* pM,int** pmdims_array,int** pndims_array,int enum_type){
     200void Parameters::FindParam(double*** parray,int* pM,int** pmdims_array,int** pndims_array,int enum_type){ _assert_(this);
    201201       
    202202        vector<Object*>::iterator object;
     
    215215/*}}}*/
    216216/*FUNCTION Parameters::FindParam(Vec* pvec,int enum_type){{{1*/
    217 void Parameters::FindParam(Vec* pvec,int enum_type){
     217void Parameters::FindParam(Vec* pvec,int enum_type){ _assert_(this);
    218218       
    219219        vector<Object*>::iterator object;
     
    233233/*}}}*/
    234234/*FUNCTION Parameters::FindParam(Mat* pmat,int enum_type){{{1*/
    235 void Parameters::FindParam(Mat* pmat,int enum_type){
     235void Parameters::FindParam(Mat* pmat,int enum_type){ _assert_(this);
    236236       
    237237        vector<Object*>::iterator object;
     
    251251/*}}}*/
    252252/*FUNCTION Parameters::FindParam(FILE** pfid,int enum_type){{{1*/
    253 void Parameters::FindParam(FILE** pfid,int enum_type){
     253void Parameters::FindParam(FILE** pfid,int enum_type){ _assert_(this);
    254254
    255255        vector<Object*>::iterator object;
  • issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h

    r8363 r8376  
    136136        TriaVertexInputEnum,
    137137        TriaVertexForcingEnum,
     138        PentaVertexForcingEnum,
    138139        ControlInputEnum,
    139140        /*Params: */
  • issm/trunk/src/c/Makefile.am

    r8363 r8376  
    198198                                        ./objects/Inputs/PentaVertexInput.h\
    199199                                        ./objects/Inputs/PentaVertexInput.cpp\
     200                                        ./objects/Inputs/PentaVertexForcing.h\
     201                                        ./objects/Inputs/PentaVertexForcing.cpp\
    200202                                        ./objects/Inputs/BoolInput.h\
    201203                                        ./objects/Inputs/BoolInput.cpp\
     
    845847                                        ./objects/Inputs/PentaVertexInput.h\
    846848                                        ./objects/Inputs/PentaVertexInput.cpp\
     849                                        ./objects/Inputs/PentaVertexForcing.h\
     850                                        ./objects/Inputs/PentaVertexForcing.cpp\
    847851                                        ./objects/Inputs/BoolInput.h\
    848852                                        ./objects/Inputs/BoolInput.cpp\
  • issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp

    r8363 r8376  
    115115                case TriaVertexInputEnum : return "TriaVertexInput";
    116116                case TriaVertexForcingEnum : return "TriaVertexForcing";
     117                case PentaVertexForcingEnum : return "PentaVertexForcing";
    117118                case ControlInputEnum : return "ControlInput";
    118119                case ParamEnum : return "Param";
  • issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp

    r8363 r8376  
    113113        else if (strcmp(name,"TriaVertexInput")==0) return TriaVertexInputEnum;
    114114        else if (strcmp(name,"TriaVertexForcing")==0) return TriaVertexForcingEnum;
     115        else if (strcmp(name,"PentaVertexForcing")==0) return PentaVertexForcingEnum;
    115116        else if (strcmp(name,"ControlInput")==0) return ControlInputEnum;
    116117        else if (strcmp(name,"Param")==0) return ParamEnum;
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r8303 r8376  
    467467        /*point parameters to real dataset: */
    468468        this->parameters=parametersin;
     469
     470        /*get inputs configured too: */
     471        this->inputs->Configure(parameters);
    469472}
    470473/*}}}*/
     
    62636266}
    62646267/*}}}*/
     6268/*FUNCTION Penta::UpdateForcing(int index,IoModel* iomodel,int step,double time, int FieldEnum){{{1*/
     6269void Penta::UpdateForcing(int index,IoModel* iomodel,int step,double time, int FieldEnum,Parameters* parameters){
     6270
     6271        /*Intermediaries*/
     6272        int i,j;
     6273        int penta_vertex_ids[6];
     6274        double  nodeinputs[6];
     6275
     6276        /*Recover vertices ids needed to initialize inputs*/
     6277        for(i=0;i<6;i++) penta_vertex_ids[i]=(int)iomodel->elements[3*index+i]; //ids for vertices are in the elements array from Matlab
     6278
     6279        /*recover forcing for this time step: */
     6280        for(i=0;i<6;i++)nodeinputs[i]=iomodel->forcing[penta_vertex_ids[i]-1];
     6281
     6282        /*process units: */
     6283        UnitConversion(&nodeinputs[0],6,ExtToIuEnum, FieldEnum, parameters);
     6284
     6285        if(step==0){
     6286                /*This is the first time we are trying to replace the accumulation penta vertex input by an accumulation pentav vertex
     6287                 *forcing, which is essentially a penta vertex input that can vary with time. So firt, if there is already
     6288                 an input with enum FieldEnum, squash it: */
     6289                this->inputs->AddInput(new PentaVertexForcing(FieldEnum,nodeinputs,time,iomodel->forcing_numtimesteps,this->parameters));
     6290        }
     6291        else{
     6292
     6293                /*Ok, we can't write over the existing forcing that was created in previous step 0. Find the input, and add
     6294                 *values for this time step: */
     6295                PentaVertexForcing* forcing=(PentaVertexForcing*)inputs->GetInput(FieldEnum); _assert_(forcing);
     6296                forcing->AddTimeValues(&nodeinputs[0],step,time);
     6297
     6298        }
     6299
     6300
     6301}
     6302/*}}}*/
    62656303/*FUNCTION Penta::UpdateShelfStatus{{{1*/
    62666304int Penta::UpdateShelfStatus(Vec new_shelf_nodes){
  • issm/trunk/src/c/objects/Elements/Penta.h

    r8365 r8376  
    129129                double SurfaceArea(void);
    130130                void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
    131                 void   UpdateForcing(int index, IoModel* iomodel,int step,double time, int FieldEnum,Parameters* parameters){_error_("not supported yet!");}
     131                void   UpdateForcing(int index, IoModel* iomodel,int step,double time, int FieldEnum,Parameters* parameters);
    132132                int    UpdateShelfStatus(Vec new_shelf_nodes);
    133133                void   UpdateShelfFlags(double* new_shelf_nodes);
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r8375 r8376  
    27282728        /*get inputs configured too: */
    27292729        this->inputs->Configure(parameters);
    2730 
    27312730
    27322731}
  • issm/trunk/src/c/objects/objects.h

    r8363 r8376  
    7979#include "./Inputs/IntInput.h"
    8080#include "./Inputs/PentaVertexInput.h"
     81#include "./Inputs/PentaVertexForcing.h"
    8182#include "./Inputs/TriaVertexInput.h"
    8283#include "./Inputs/TriaVertexForcing.h"
Note: See TracChangeset for help on using the changeset viewer.