Changeset 16800


Ignore:
Timestamp:
11/16/13 08:58:30 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: implementing PVector in analysis for SSA and removing CreateKMatrix(pf)

Location:
issm/trunk-jpl/src/c
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp

    r16799 r16800  
    881881}/*}}}*/
    882882ElementVector* StressbalanceAnalysis::CreatePVectorSSAFront(Element* element){/*{{{*/
    883 
     883        return NULL;
    884884}/*}}}*/
    885885void StressbalanceAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
  • issm/trunk-jpl/src/c/classes/Elements/Element.h

    r16799 r16800  
    4343                virtual void   AddInput(int input_enum, IssmDouble* values, int interpolation_enum)=0;
    4444                virtual void   AddMaterialInput(int input_enum, IssmDouble* values, int interpolation_enum)=0;
    45                 virtual void   CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>*  Kfs)=0;
    4645                virtual ElementMatrix* CreateKMatrix(void)=0;
    4746                virtual void   CreateDVector(Vector<IssmDouble>* df)=0;
    48                 virtual void   CreatePVector(Vector<IssmDouble>* pf)=0;
    4947                virtual ElementVector* CreatePVector(void)=0;
    5048                virtual void   CreateJacobianMatrix(Matrix<IssmDouble>* Jff)=0;
  • issm/trunk-jpl/src/c/classes/Elements/Penta.cpp

    r16799 r16800  
    414414        /*get inputs configured too: */
    415415        this->inputs->Configure(parameters);
    416 }
    417 /*}}}*/
    418 /*FUNCTION Penta::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs) {{{*/
    419 void  Penta::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){
    420 
    421         /*Skip if water element*/
    422         if(NoIceInElement()) return;
    423 
    424         /*Create element stiffness matrix*/
    425         ElementMatrix* Ke=CreateKMatrix();
    426 
    427         if(Ke){
    428                 int analysis_type;
    429                 parameters->FindParam(&analysis_type,AnalysisTypeEnum);
    430                 if(analysis_type==StressbalanceAnalysisEnum){
    431                         int approximation;
    432                         inputs->GetInputValue(&approximation,ApproximationEnum);
    433                         if(approximation==HOFSApproximationEnum || approximation==SSAFSApproximationEnum){
    434                                 //Do nothing condensatino already done for Stokes part
    435                         }
    436                         else{
    437                                 /*Condense if requested*/
    438                                 if(this->element_type==MINIcondensedEnum){
    439                                         int indices[3]={18,19,20};
    440                                         Ke->StaticCondensation(3,&indices[0]);
    441                                 }
    442                                 else if(this->element_type==P1bubblecondensedEnum){
    443                                         int size   = nodes[6]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
    444                                         int offset = 0;
    445                                         for(int i=0;i<6;i++) offset+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
    446                                         int* indices=xNew<int>(size);
    447                                         for(int i=0;i<size;i++) indices[i] = offset+i;
    448                                         Ke->StaticCondensation(size,indices);
    449                                         xDelete<int>(indices);
    450                                 }
    451                         }
    452                 }
    453 
    454                 /*Add to global matrix*/
    455                 Ke->AddToGlobal(Kff,Kfs);
    456                 delete Ke;
    457         }
    458416}
    459417/*}}}*/
     
    618576                De->InsertIntoGlobal(df);
    619577                delete De;
    620         }
    621 }
    622 /*}}}*/
    623 /*FUNCTION Penta::CreatePVector(Vector<IssmDouble>* pf) {{{*/
    624 void  Penta::CreatePVector(Vector<IssmDouble>* pf){
    625 
    626         /*Skip if water element*/
    627         if(NoIceInElement()) return;
    628 
    629         /*Create element load vector*/
    630         ElementVector* pe = CreatePVector();
    631 
    632         if(pe){
    633                 int analysis_type;
    634                 parameters->FindParam(&analysis_type,AnalysisTypeEnum);
    635                 if(analysis_type==StressbalanceAnalysisEnum){
    636                         /*StaticCondensation if requested*/
    637                         if(this->element_type==MINIcondensedEnum){
    638                                 int approximation;
    639                                 inputs->GetInputValue(&approximation,ApproximationEnum);
    640                                 if(approximation==HOFSApproximationEnum || approximation==SSAFSApproximationEnum){
    641                                         //Do nothing, condensation already done in PVectorCoupling
    642                                 }
    643                                 else{
    644                                         int indices[3]={18,19,20};
    645 
    646                                         this->element_type=MINIEnum;
    647                                         ElementMatrix* Ke = CreateKMatrixStressbalanceFS();
    648                                         this->element_type=MINIcondensedEnum;
    649 
    650                                         pe->StaticCondensation(Ke,3,&indices[0]);
    651                                         delete Ke;
    652                                 }
    653                         }
    654                         else if(this->element_type==P1bubblecondensedEnum){
    655                                 int size   = nodes[6]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
    656                                 int offset = 0;
    657                                 for(int i=0;i<6;i++) offset+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
    658                                 int* indices=xNew<int>(size);
    659                                 for(int i=0;i<size;i++) indices[i] = offset+i;
    660 
    661                                 this->element_type=P1bubbleEnum;
    662                                 ElementMatrix* Ke = CreateKMatrix();
    663                                 this->element_type=P1bubblecondensedEnum;
    664                                 pe->StaticCondensation(Ke,size,indices);
    665                                 xDelete<int>(indices);
    666                                 delete Ke;
    667                         }
    668                 }
    669 
    670                 /*Add to global Vector*/
    671                 pe->AddToGlobal(pf);
    672                 delete pe;
    673578        }
    674579}
     
    26672572}
    26682573/*}}}*/
    2669 /*FUNCTION Penta::ReduceMatrices) {{{*/
     2574/*FUNCTION Penta::ReduceMatrices{{{*/
    26702575void Penta::ReduceMatrices(ElementMatrix* Ke,ElementVector* pe){
    26712576
  • issm/trunk-jpl/src/c/classes/Elements/Penta.h

    r16799 r16800  
    7979                void   SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters);
    8080                void   SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum);
    81                 void   CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
    8281                void   CreateDVector(Vector<IssmDouble>* df);
    83                 void   CreatePVector(Vector<IssmDouble>* pf);
    8482                void   CreateJacobianMatrix(Matrix<IssmDouble>* Jff);
    8583                void   Delta18oParameterization(void);
  • issm/trunk-jpl/src/c/classes/Elements/Seg.h

    r16799 r16800  
    7777                void        SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters){_error_("not implemented yet");};
    7878                void        SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){_error_("not implemented yet");};
    79                 void        CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){_error_("not implemented yet");};
    8079                ElementMatrix* CreateKMatrix(void){_error_("not implemented yet");};
    8180                void        CreateDVector(Vector<IssmDouble>* df){_error_("not implemented yet");};
    82                 void        CreatePVector(Vector<IssmDouble>* pf){_error_("not implemented yet");};
    8381                ElementVector* CreatePVector(void){_error_("not implemented yet");};
    8482                ElementVector* CreatePVectorL2Projection(void);
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r16799 r16800  
    196196        _assert_(this->material);
    197197        this->material->inputs->AddInput(new TriaInput(input_enum,values,interpolation_enum));
    198 }
    199 /*}}}*/
    200 /*FUNCTION Tria::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs) {{{*/
    201 void  Tria::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){
    202 
    203 
    204         /*Skip if water element*/
    205         if(NoIceInElement()) return;
    206 
    207         /*Create element stiffness matrix*/
    208         ElementMatrix* Ke=CreateKMatrix();
    209 
    210         if(Ke){
    211                 /*Static condensation if requested*/
    212                 if(this->element_type==MINIcondensedEnum){
    213                         int indices[2]={6,7};
    214                         Ke->StaticCondensation(2,&indices[0]);
    215                 }
    216                 else if(this->element_type==P1bubblecondensedEnum){
    217                         int size   = nodes[3]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
    218                         int offset = 0;
    219                         for(int i=0;i<3;i++) offset+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
    220                         int* indices=xNew<int>(size);
    221                         for(int i=0;i<size;i++) indices[i] = offset+i;
    222                         Ke->StaticCondensation(size,indices);
    223                         xDelete<int>(indices);
    224                 }
    225 
    226                 /*Add to global matrix*/
    227                 Ke->AddToGlobal(Kff,Kfs);
    228                 delete Ke;
    229         }
    230198}
    231199/*}}}*/
     
    411379
    412380        /*Nothing done yet*/
    413 }
    414 /*}}}*/
    415 /*FUNCTION Tria::CreatePVector(Vector<IssmDouble>* pf) {{{*/
    416 void  Tria::CreatePVector(Vector<IssmDouble>* pf){
    417 
    418         /*Skip if water element*/
    419         if(NoIceInElement()) return;
    420 
    421         /*Create element load vector*/
    422         ElementVector* pe = CreatePVector();
    423 
    424         /*Add to global Vector*/
    425         if(pe){
    426                 /*Static condensation if requested*/
    427                 if(this->element_type==MINIcondensedEnum){
    428                         int indices[2]={6,7};
    429                         this->element_type=MINIEnum;
    430                         ElementMatrix* Ke = CreateKMatrixStressbalanceFS();
    431                         this->element_type=MINIcondensedEnum;
    432 
    433                         pe->StaticCondensation(Ke,2,&indices[0]);
    434                         delete Ke;
    435                 }
    436                 else if(this->element_type==P1bubblecondensedEnum){
    437                         int size   = nodes[3]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
    438                         int offset = 0;
    439                         for(int i=0;i<3;i++) offset+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
    440                         int* indices=xNew<int>(size);
    441                         for(int i=0;i<size;i++) indices[i] = offset+i;
    442 
    443                         this->element_type=P1bubbleEnum;
    444                         ElementMatrix* Ke = CreateKMatrix();
    445                         this->element_type=P1bubblecondensedEnum;
    446 
    447                         pe->StaticCondensation(Ke,size,indices);
    448                         xDelete<int>(indices);
    449                         delete Ke;
    450                 }
    451 
    452                 pe->AddToGlobal(pf);
    453                 delete pe;
    454         }
    455381}
    456382/*}}}*/
     
    12261152}
    12271153/*}}}*/
     1154/*FUNCTION Tria::GetVerticesCoordinates(IssmDouble** pxyz_list){{{*/
     1155void Tria::GetVerticesCoordinates(IssmDouble** pxyz_list){
     1156
     1157        IssmDouble* xyz_list = xNew<IssmDouble>(NUMVERTICES*3);
     1158        ::GetVerticesCoordinates(xyz_list,this->vertices,NUMVERTICES);
     1159
     1160        /*Assign output pointer*/
     1161        *pxyz_list = xyz_list;
     1162
     1163}/*}}}*/
    12281164/*FUNCTION Tria::GetSegmentNormal {{{*/
    12291165void Tria:: GetSegmentNormal(IssmDouble* normal,IssmDouble xyz_list[2][3]){
  • issm/trunk-jpl/src/c/classes/Elements/Tria.h

    r16799 r16800  
    7373                void        SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters);
    7474                void        SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum);
    75                 void        CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
    7675                void        CreateDVector(Vector<IssmDouble>* df);
    77                 void        CreatePVector(Vector<IssmDouble>* pf);
    7876                void        CreateJacobianMatrix(Matrix<IssmDouble>* Jff);
    7977                void        DeleteMaterials(void);
     
    111109                void        GetSolutionFromInputsOneDof(Vector<IssmDouble>* solution,int enum_type);
    112110                void        GetVectorFromInputs(Vector<IssmDouble>* vector, int name_enum);
    113                 void        GetVerticesCoordinates(IssmDouble** pxyz_list){_error_("not implemented yet");};
     111                void        GetVerticesCoordinates(IssmDouble** pxyz_list);
    114112                void        InputCreate(IssmDouble* vector,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code);
    115113                void        InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum=MeshElementsEnum);
Note: See TracChangeset for help on using the changeset viewer.