Changeset 13939


Ignore:
Timestamp:
11/12/12 13:34:54 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: reverting back to old allocation, Newton's module needs to be fixed (moved it to FemModel)

Location:
issm/trunk-jpl/src/c
Files:
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/Makefile.am

    r13936 r13939  
    299299                                        ./modules/StringToEnumx/StringToEnumx.cpp\
    300300                                        ./modules/StringToEnumx/StringToEnumx.h\
    301                                         ./modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp\
    302                                         ./modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h\
    303301                                        ./modules/ConstraintsStatex/ConstraintsStatex.cpp\
    304302                                        ./modules/ConstraintsStatex/ConstraintsStatex.h\
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r13938 r13939  
    353353        Vector<IssmDouble> *df   = NULL;
    354354
    355         bool oldalloc=false;
     355        bool oldalloc=true;
    356356
    357357        /*retrieve parameters: */
     
    538538
    539539        /*sum over all cpus*/
    540         #ifdef _HAVE_MPI_
     540#ifdef _HAVE_MPI_
    541541        MPI_Allreduce((void*)connectivity_clone,(void*)all_connectivity_clone,numnodes,MPI_INT,MPI_SUM,IssmComm::GetComm());
    542         #endif
     542#endif
    543543        xDelete<int>(connectivity_clone);
    544544
     
    572572        *pd_nnz=d_nnz;
    573573        *po_nnz=o_nnz;
     574
     575}/*}}}*/
     576void FemModel::CreateJacobianMatrixx(Matrix<IssmDouble>** pJff,IssmDouble kmax){/*{{{*/
     577
     578        int      i,connectivity;
     579        int      numberofdofspernode;
     580        int      fsize,configuration_type;
     581        Element *element = NULL;
     582        Load    *load    = NULL;
     583        Matrix<IssmDouble>* Jff = NULL;
     584
     585        /*Checks*/
     586        _assert_(nodes && elements);
     587
     588        /*Recover some parameters*/
     589        parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
     590        parameters->FindParam(&connectivity,MeshAverageVertexConnectivityEnum);
     591        fsize=nodes->NumberOfDofs(configuration_type,FsetEnum);
     592        numberofdofspernode=nodes->MaxNumDofs(configuration_type,GsetEnum);
     593
     594        /*Initialize Jacobian Matrix*/
     595        this->AllocateSystemMatrices(&Jff,NULL,NULL,NULL);
     596        Jff=new Matrix<IssmDouble>(fsize,fsize,connectivity,numberofdofspernode);
     597
     598        /*Create and assemble matrix*/
     599        for(i=0;i<elements->Size();i++){
     600                element=dynamic_cast<Element*>(elements->GetObjectByOffset(i));
     601                element->CreateJacobianMatrix(Jff);
     602        }
     603        for (i=0;i<loads->Size();i++){
     604                load=(Load*)loads->GetObjectByOffset(i);
     605                if(load->InAnalysis(configuration_type)) load->CreateJacobianMatrix(Jff);
     606                if(load->InAnalysis(configuration_type)) load->PenaltyCreateJacobianMatrix(Jff,kmax);
     607        }
     608        Jff->Assemble();
     609
     610        /*Assign output pointer*/
     611        *pJff=Jff;
    574612
    575613}/*}}}*/
  • issm/trunk-jpl/src/c/classes/FemModel.h

    r13881 r13939  
    5353                /*Methods:*/
    5454                void AllocateSystemMatrices(Matrix<IssmDouble>** pKff,Matrix<IssmDouble>** pKfs,Vector<IssmDouble>** pdf,Vector<IssmDouble>** ppf);
     55                void CreateJacobianMatrixx(Matrix<IssmDouble>** pJff,IssmDouble kmax);
    5556                void Echo();
    5657                void InitFromFiles(char* rootpath, char* inputfilename, char* outputfilename, char* petscfilename, char* lockfilename, const int solution_type,const int* analyses,const int nummodels);
  • issm/trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.cpp

    r13762 r13939  
    2020        int         global_m,global_n;
    2121        bool        fromlocalsize = true;
     22        bool        oldalloc  = true;
    2223
    2324        if(VerboseModule()) _pprintLine_("   Dirichlet lifting applied to load vector");
     
    3132                /*pf = pf - Kfs * y_s;*/
    3233                Kfs->GetLocalSize(&Kfsm,&Kfsn);
    33                 Kfsy_s=new Vector<IssmDouble>(Kfsm,fromlocalsize);
     34                if(oldalloc)
     35                 Kfsy_s=new Vector<IssmDouble>(Kfsm,fromlocalsize);
     36                else
     37                 Kfsy_s=new Vector<IssmDouble>(Kfsm,global_m);
     38
    3439                if (flag_ys0){
    3540
  • issm/trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp

    r13938 r13939  
    1515        int         fsize;
    1616        IssmDouble *ug_serial = NULL;
    17         bool        oldalloc  = false;
     17        bool        oldalloc  = true;
    1818
    1919        /*first figure out fsize: */
  • issm/trunk-jpl/src/c/modules/modules.h

    r13877 r13939  
    9191#include "./SpcNodesx/SpcNodesx.h"
    9292#include "./SurfaceAreax/SurfaceAreax.h"
    93 #include "./CreateJacobianMatrixx/CreateJacobianMatrixx.h"
    9493#include "./TriaSearchx/TriaSearchx.h"
    9594#include "./TriMeshx/TriMeshx.h"
Note: See TracChangeset for help on using the changeset viewer.