Changeset 3928


Ignore:
Timestamp:
05/24/10 16:39:14 (15 years ago)
Author:
seroussi
Message:

completed some routines needed for Hutter 3d

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

Legend:

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

    r3887 r3928  
    247247}
    248248/*}}}*/
     249/*FUNCTION Beam::IsInput{{{1*/
     250bool Beam::IsInput(int name){
     251        if (name==SurfaceSlopexEnum ||
     252                                name==SurfaceSlopeyEnum){
     253                return true;
     254        }
     255        else return false;
     256}
     257/*}}}*/
    249258/*FUNCTION Beam::Marshall{{{1*/
    250259void  Beam::Marshall(char** pmarshalled_dataset){
     
    761770/*FUNCTION Beam::UpdateInputsFromVector(double* vector, int name, int type);{{{1*/
    762771void  Beam::UpdateInputsFromVector(double* vector, int name, int type){
    763         ISSMERROR(" not supported yet!");
     772
     773        /*Check that name is an element input*/
     774        if (!IsInput(name)) return;
     775        Node**  nodes=NULL;
     776
     777        switch(type){
     778
     779                case VertexEnum:
     780
     781                        /*New PentaVertexInpu*/
     782                        double values[2];
     783
     784                        /*Get values on the 6 vertices*/
     785                        nodes=(Node**)hnodes.deliverp();
     786                        for (int i=0;i<2;i++){
     787                                values[i]=vector[nodes[i]->GetVertexDof()];
     788                        }
     789
     790                        /*update input*/
     791                        this->inputs->AddInput(new BeamVertexInput(name,values));
     792                        return;
     793
     794                default:
     795
     796                        ISSMERROR("type %i (%s) not implemented yet",type,EnumAsString(type));
     797        }
    764798}
    765799/*}}}*/
  • issm/trunk/src/c/objects/Elements/Beam.h

    r3887 r3928  
    4848                int   Enum();
    4949                int   Id();
     50                bool  IsInput(int name);
    5051                int   MyRank();
    5152                void  Configure(DataSet* elements,DataSet* loads,DataSet* nodes,DataSet* materials,Parameters* parameters);
  • issm/trunk/src/c/objects/Elements/Sing.cpp

    r3920 r3928  
    561561void  Sing::UpdateInputsFromVector(double* vector, int name, int type){
    562562
    563         Node*  node=NULL;
    564563        /*Check that name is an element input*/
    565564        if (!IsInput(name)) return;
     565        Node*  node=NULL;
    566566
    567567        switch(type){
  • issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp

    r3847 r3928  
    155155/*}}}*/
    156156/*FUNCTION BeamVertexInput::GetParameterValue(double* pvalue,double* gauss){{{1*/
    157 void BeamVertexInput::GetParameterValue(double* pvalue,double* gauss){ISSMERROR(" not supported yet!");}
     157void BeamVertexInput::GetParameterValue(double* pvalue,double* gauss){
     158        *pvalue=gauss[0]*values[0]+gauss[1]*values[1];
     159}
    158160/*}}}*/
    159161/*FUNCTION BeamVertexInput::GetParameterValue(double* pvalue,double* gauss,double defaultvalue){{{1*/
     
    161163/*}}}*/
    162164/*FUNCTION BeamVertexInput::GetParameterValues(double* values,double* gauss_pointers, int numgauss){{{1*/
    163 void BeamVertexInput::GetParameterValues(double* values,double* gauss_pointers, int numgauss){ISSMERROR(" not supported yet!");}
     165void BeamVertexInput::GetParameterValues(double* pvalues,double* gauss_pointers, int numgauss){
     166        /*It is assumed that output has been correctly allocated*/
     167
     168        int i,j;
     169        double gauss[2];
     170
     171        for(i=0;i<numgauss;i++){
     172                /*Get current Gauss point coordinates*/
     173                for (j=0;j<2;j++) gauss[j]=gauss_pointers[i*2+j];
     174
     175                /*Assign parameter value*/
     176                GetParameterValue(&values[i],&gauss[0]);
     177        }
     178}
    164179/*}}}*/
    165180/*FUNCTION BeamVertexInput::GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, double* gauss){{{1*/
Note: See TracChangeset for help on using the changeset viewer.