Changeset 3935


Ignore:
Timestamp:
05/25/10 08:17:56 (15 years ago)
Author:
Mathieu Morlighem
Message:

Added SpawnBeam method of Penta for Hutter

Location:
issm/trunk/src/c
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/DataSet/DataSet.h

    r3887 r3935  
    133133                Input* GetInput(int enum_name);
    134134                Inputs* SpawnTriaInputs(int* indices);
     135                Inputs* SpawnBeamInputs(int* indices);
    135136               
    136137                void GetParameterValue(bool* pvalue,int enum_type);
  • issm/trunk/src/c/DataSet/Inputs.cpp

    r3869 r3935  
    576576}
    577577/*}}}*/
     578/*FUNCTION Inputs::SpawnBeamInputs{{{1*/
     579Inputs* Inputs::SpawnBeamInputs(int* indices){
     580
     581        /*Intermediary*/
     582        vector<Object*>::iterator object;
     583        Input* inputin=NULL;
     584        Input* inputout=NULL;
     585
     586        /*Output*/
     587        Inputs* newinputs=new Inputs();
     588
     589        /*Go through inputs and call Spawn function*/
     590        for ( object=objects.begin() ; object < objects.end(); object++ ){
     591
     592                /*Create new input*/
     593                inputin=(Input*)(*object);
     594                inputout=inputin->SpawnBeamInput(indices);
     595
     596                /*Add input to new inputs*/
     597                newinputs->AddObject(inputout);
     598        }
     599
     600        /*Assign output pointer*/
     601        return newinputs;
     602}
     603/*}}}*/
    578604/*FUNCTION Inputs::SpawnTriaInputs{{{1*/
    579605Inputs* Inputs::SpawnTriaInputs(int* indices){
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r3887 r3935  
    459459
    460460        return tria;
     461}
     462/*}}}*/
     463/*FUNCTION Penta::SpawnBeam {{{1*/
     464void* Penta::SpawnBeam(int g0, int g1){
     465
     466        /*out of grids g0,g1 and g2 from Penta, build a beam element: */
     467        Beam* beam=NULL;
     468        int indices[2];
     469        int zero=0;
     470        Hook       *beam_hnodes     = NULL;
     471        Hook       *beam_hmatice    = NULL;
     472        Hook       *beam_hmatpar    = NULL;
     473        Parameters *beam_parameters = NULL;
     474        Inputs     *beam_inputs     = NULL;
     475
     476        indices[0]=g0;
     477        indices[1]=g1;
     478
     479        beam_hnodes =this->hnodes.Spawn(indices,2);
     480        beam_hmatice=this->hmatice.Spawn(&zero,1);
     481        beam_hmatpar=this->hmatpar.Spawn(&zero,1);
     482        beam_parameters=this->parameters;
     483        beam_inputs=(Inputs*)this->inputs->SpawnBeamInputs(indices);
     484
     485        beam=new Beam();
     486        beam->id=this->id;
     487        beam->inputs=beam_inputs;
     488        beam->parameters=beam_parameters;
     489
     490        /*now deal with hooks and objects: */
     491        beam->hnodes.copy(beam_hnodes);
     492        beam->hmatice.copy(beam_hmatice);
     493        beam->hmatpar.copy(beam_hmatpar);
     494
     495        /*recover objects: */
     496        //beam->nodes=(Node**)beam->hnodes.deliverp();
     497        //beam->matice=(Matice*)beam->hmatice.delivers();
     498        //beam->matpar=(Matpar*)beam->hmatpar.delivers();
     499
     500        delete beam_hnodes;
     501        delete beam_hmatice;
     502        delete beam_hmatpar;
     503
     504        return beam;
    461505}
    462506/*}}}*/
  • issm/trunk/src/c/objects/Elements/Penta.h

    r3887 r3935  
    5656                int   MarshallSize();
    5757                int   MyRank();
     58                void*  SpawnBeam(int g0, int g1);
    5859                void*  SpawnTria(int g0, int g1, int g2);
    5960                void  SetClone(int* minranks);
  • issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp

    r3928 r3935  
    130130}
    131131/*}}}*/
     132/*FUNCTION BeamVertexInput::SpawnBeamInput{{{1*/
     133Input* BeamVertexInput::SpawnBeamInput(int* indices){
     134
     135        /*output*/
     136        BeamVertexInput* outinput=NULL;
     137
     138        /*Create new Beam input (copy of current input)*/
     139        outinput=new BeamVertexInput(this->enum_type,&this->values[0]);
     140
     141        /*Assign output*/
     142        return outinput;
     143
     144}
     145/*}}}*/
    132146/*FUNCTION BeamVertexInput::SpawnTriaInput{{{1*/
    133147Input* BeamVertexInput::SpawnTriaInput(int* indices){
  • issm/trunk/src/c/objects/Inputs/BeamVertexInput.h

    r3855 r3935  
    4747                void  UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4848
     49                Input* SpawnBeamInput(int* indices);
    4950                Input* SpawnTriaInput(int* indices);
    5051                /*}}}*/
  • issm/trunk/src/c/objects/Inputs/BoolInput.cpp

    r3847 r3935  
    129129}
    130130/*}}}*/
     131/*FUNCTION BoolInput::SpawnBeamInput{{{1*/
     132Input* BoolInput::SpawnBeamInput(int* indices){
     133
     134        /*output*/
     135        BoolInput* outinput=new BoolInput();
     136
     137        /*only copy current value*/
     138        outinput->enum_type=this->enum_type;
     139        outinput->value=this->value;
     140
     141        /*Assign output*/
     142        return outinput;
     143
     144}
     145/*}}}*/
    131146/*FUNCTION BoolInput::SpawnTriaInput{{{1*/
    132147Input* BoolInput::SpawnTriaInput(int* indices){
  • issm/trunk/src/c/objects/Inputs/BoolInput.h

    r3855 r3935  
    4747                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4848
     49                Input* SpawnBeamInput(int* indices);
    4950                Input* SpawnTriaInput(int* indices);
    5051                /*}}}*/
  • issm/trunk/src/c/objects/Inputs/DoubleInput.cpp

    r3860 r3935  
    129129}
    130130/*}}}*/
    131 /*FUNCTION DoubleInput::SpawnTriaInput{{{1*/
    132 Input* DoubleInput::SpawnTriaInput(int* indices){
     131/*FUNCTION DoubleInput::SpawnBeamInput{{{1*/
     132Input* DoubleInput::SpawnBeamInput(int* indices){
    133133
    134134        /*output*/
     
    144144}
    145145/*}}}*/
     146/*FUNCTION DoubleInput::SpawnTriaInput{{{1*/
     147Input* DoubleInput::SpawnTriaInput(int* indices){
     148
     149        /*output*/
     150        DoubleInput* outinput=new DoubleInput();
     151
     152        /*only copy current value*/
     153        outinput->enum_type=this->enum_type;
     154        outinput->value=this->value;
     155
     156        /*Assign output*/
     157        return outinput;
     158
     159}
     160/*}}}*/
    146161
    147162/*Object functions*/
  • issm/trunk/src/c/objects/Inputs/DoubleInput.h

    r3855 r3935  
    4747                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4848
     49                Input* SpawnBeamInput(int* indices);
    4950                Input* SpawnTriaInput(int* indices);
    5051                /*}}}*/
  • issm/trunk/src/c/objects/Inputs/Input.h

    r3855 r3935  
    4444                virtual void GetVyStrainRate3dPattyn(double* epsilonvy,double* xyz_list, double* gauss)=0;
    4545                virtual void ChangeEnum(int newenumtype)=0;
     46                virtual Input* SpawnBeamInput(int* indices)=0;
    4647                virtual Input* SpawnTriaInput(int* indices)=0;
    4748                /*}}}*/
  • issm/trunk/src/c/objects/Inputs/IntInput.cpp

    r3847 r3935  
    129129}
    130130/*}}}*/
     131/*FUNCTION IntInput::SpawnBeamInput{{{1*/
     132Input* IntInput::SpawnBeamInput(int* indices){
     133
     134        /*output*/
     135        IntInput* outinput=new IntInput();
     136
     137        /*only copy current value*/
     138        outinput->enum_type=this->enum_type;
     139        outinput->value=this->value;
     140
     141        /*Assign output*/
     142        return outinput;
     143}
     144/*}}}*/
    131145/*FUNCTION IntInput::SpawnTriaInput{{{1*/
    132146Input* IntInput::SpawnTriaInput(int* indices){
  • issm/trunk/src/c/objects/Inputs/IntInput.h

    r3855 r3935  
    4747                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4848
     49                Input* SpawnBeamInput(int* indices);
    4950                Input* SpawnTriaInput(int* indices);
    5051                /*}}}*/
  • issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp

    r3875 r3935  
    132132        extern int my_rank;
    133133        return my_rank;
     134}
     135/*}}}*/
     136/*FUNCTION PentaVertexInput::SpawnBeamInput{{{1*/
     137Input* PentaVertexInput::SpawnBeamInput(int* indices){
     138
     139        /*output*/
     140        BeamVertexInput* outinput=NULL;
     141        double newvalues[2];
     142
     143        /*Loop over the new indices*/
     144        for(int i=0;i<2;i++){
     145
     146                /*Check index value*/
     147                ISSMASSERT(indices[i]>=0 && indices[i]<6);
     148
     149                /*Assign value to new input*/
     150                newvalues[i]=this->values[indices[i]];
     151        }
     152
     153        /*Create new Beam input*/
     154        outinput=new BeamVertexInput(this->enum_type,&newvalues[0]);
     155
     156        /*Assign output*/
     157        return outinput;
     158
    134159}
    135160/*}}}*/
  • issm/trunk/src/c/objects/Inputs/PentaVertexInput.h

    r3855 r3935  
    4646                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4747
     48                Input* SpawnBeamInput(int* indices);
    4849                Input* SpawnTriaInput(int* indices);
    4950                /*}}}*/
  • issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp

    r3920 r3935  
    129129}
    130130/*}}}*/
     131/*FUNCTION SingVertexInput::SpawnBeamInput{{{1*/
     132Input* SingVertexInput::SpawnBeamInput(int* indices){
     133
     134        ISSMERROR("Cannot spaw a Beam from a Sing");
     135
     136}
     137/*}}}*/
    131138/*FUNCTION SingVertexInput::SpawnTriaInput{{{1*/
    132139Input* SingVertexInput::SpawnTriaInput(int* indices){
  • issm/trunk/src/c/objects/Inputs/SingVertexInput.h

    r3855 r3935  
    4646                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4747
     48                Input* SpawnBeamInput(int* indices);
    4849                Input* SpawnTriaInput(int* indices);
    4950                /*}}}*/
  • issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp

    r3855 r3935  
    131131}
    132132/*}}}*/
     133/*FUNCTION BeamVertexInput::SpawnBeamInput{{{1*/
     134Input* TriaVertexInput::SpawnBeamInput(int* indices){
     135
     136        /*output*/
     137        BeamVertexInput* outinput=NULL;
     138        double newvalues[2];
     139
     140        /*Loop over the new indices*/
     141        for(int i=0;i<2;i++){
     142
     143                /*Check index value*/
     144                ISSMASSERT(indices[i]>=0 && indices[i]<3);
     145
     146                /*Assign value to new input*/
     147                newvalues[i]=this->values[indices[i]];
     148        }
     149
     150        /*Create new Beam input*/
     151        outinput=new BeamVertexInput(this->enum_type,&newvalues[0]);
     152
     153        /*Assign output*/
     154        return outinput;
     155
     156}
     157/*}}}*/
    133158/*FUNCTION TriaVertexInput::SpawnTriaInput{{{1*/
    134159Input* TriaVertexInput::SpawnTriaInput(int* indices){
     
    142167        /*Assign output*/
    143168        return outinput;
    144 
    145169
    146170}
  • issm/trunk/src/c/objects/Inputs/TriaVertexInput.h

    r3855 r3935  
    4747                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4848
     49                Input* SpawnBeamInput(int* indices);
    4950                Input* SpawnTriaInput(int* indices);
    5051                /*}}}*/
Note: See TracChangeset for help on using the changeset viewer.