Changeset 3920


Ignore:
Timestamp:
05/24/10 13:56:27 (15 years ago)
Author:
seroussi
Message:

completed some routines needed for Hutter

Location:
issm/trunk/src/c/objects
Files:
5 edited

Legend:

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

    r3887 r3920  
    185185        printf("   inputs\n");
    186186        inputs->Echo();
     187}
     188/*}}}*/
     189/*FUNCTION Sing::IsInput{{{1*/
     190bool Sing::IsInput(int name){
     191        if (name==SurfaceSlopexEnum ||
     192                                name==SurfaceSlopeyEnum){
     193                return true;
     194        }
     195        else return false;
    187196}
    188197/*}}}*/
     
    551560/*FUNCTION Sing::UpdateInputsFromVector(double* vector, int name, int type);{{{1*/
    552561void  Sing::UpdateInputsFromVector(double* vector, int name, int type){
    553         ISSMERROR(" not supported yet!");
     562
     563        Node*  node=NULL;
     564        /*Check that name is an element input*/
     565        if (!IsInput(name)) return;
     566
     567        switch(type){
     568
     569                case VertexEnum:
     570
     571                        /*New SingVertexInpu*/
     572                        double value;
     573
     574                        /*Get values on the 6 vertices*/
     575                        node=(Node*)this->hnodes.delivers();
     576                        value=vector[node->GetVertexDof()];
     577
     578                        /*update input*/
     579                        this->inputs->AddInput(new SingVertexInput(name,value));
     580                        return;
     581
     582                default:
     583                        ISSMERROR("type %i (%s) not implemented yet",type,EnumAsString(type));
     584        }
    554585}
    555586/*}}}*/
  • issm/trunk/src/c/objects/Elements/Sing.h

    r3887 r3920  
    2626                int id;
    2727
    28                 Hook hnodes;  //hook to 2 nodes
     28                Hook hnodes;  //hook to 1 nodes
    2929                Hook hmatice; //hook to 1 matice
    3030                Hook hmatpar; //hook to 1 matpar
     
    4848                int   Enum();
    4949                int   Id();
     50                bool  IsInput(int name);
    5051                void  Marshall(char** pmarshalled_dataset);
    5152                int   MarshallSize();
     
    5556                void  UpdateInputsFromVector(int* vector, int name, int type);
    5657                void  UpdateInputsFromVector(bool* vector, int name, int type);
    57                 void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    58                 void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
    59                 void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     58                void  UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     59                void  UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     60                void  UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
    6061
    6162                void  UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type);
    6263
    63                 void   DepthAverageInputAtBase(int enum_type){ISSMERROR("not implemented yet");};
     64                void  DepthAverageInputAtBase(int enum_type){ISSMERROR("not implemented yet");};
    6465                /*}}}*/
    6566                /*numerics: {{{1*/
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r3887 r3920  
    300300void Tria::Echo(void){
    301301        this->DeepEcho();
     302}
     303/*}}}*/
     304/*FUNCTION Tria::IsInput{{{1*/
     305bool Tria::IsInput(int name){
     306        if (name==SurfaceSlopexEnum ||
     307                                name==SurfaceSlopeyEnum){
     308                return true;
     309        }
     310        else return false;
    302311}
    303312/*}}}*/
     
    46664675/*FUNCTION Tria::UpdateInputsFromVector(double* vector, int name, int type);{{{1*/
    46674676void  Tria::UpdateInputsFromVector(double* vector, int name, int type){
    4668         ISSMERROR(" not supported yet!");
     4677
     4678        /*Check that name is an element input*/
     4679        if (!IsInput(name)) return;
     4680
     4681        switch(type){
     4682
     4683                case VertexEnum:
     4684
     4685                        /*New PentaVertexInpu*/
     4686                        double values[3];
     4687
     4688                        /*Get values on the 6 vertices*/
     4689                        for (int i=0;i<3;i++){
     4690                                values[i]=vector[this->nodes[i]->GetVertexDof()];
     4691                        }
     4692
     4693                        /*update input*/
     4694                        this->inputs->AddInput(new TriaVertexInput(name,values));
     4695                        return;
     4696
     4697                default:
     4698
     4699                        ISSMERROR("type %i (%s) not implemented yet",type,EnumAsString(type));
     4700        }
    46694701}
    46704702/*}}}*/
  • issm/trunk/src/c/objects/Elements/Tria.h

    r3887 r3920  
    4848                int   Enum();
    4949                int   Id();
     50                bool  IsInput(int name);
    5051                void  Marshall(char** pmarshalled_dataset);
    5152                int   MarshallSize();
  • issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp

    r3847 r3920  
    145145/*}}}*/
    146146/*FUNCTION SingVertexInput::GetParameterValue(double* pvalue){{{1*/
    147 void SingVertexInput::GetParameterValue(double* pvalue){ISSMERROR(" not supported yet!");}
     147void SingVertexInput::GetParameterValue(double* pvalue){
     148        *pvalue=value;
     149}
    148150/*}}}*/
    149151/*FUNCTION SingVertexInput::GetParameterValue(double* pvalue,Node* node){{{1*/
Note: See TracChangeset for help on using the changeset viewer.