Changeset 13941


Ignore:
Timestamp:
11/12/12 14:01:38 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: switching new allocation back on

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

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r13939 r13941  
    353353        Vector<IssmDouble> *df   = NULL;
    354354
    355         bool oldalloc=true;
     355        bool oldalloc=false;
    356356
    357357        /*retrieve parameters: */
     
    594594        /*Initialize Jacobian Matrix*/
    595595        this->AllocateSystemMatrices(&Jff,NULL,NULL,NULL);
    596         Jff=new Matrix<IssmDouble>(fsize,fsize,connectivity,numberofdofspernode);
    597596
    598597        /*Create and assemble matrix*/
  • issm/trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.cpp

    r13622 r13941  
    1212void CreateNodalConstraintsx( Vector<IssmDouble>** pys, Nodes* nodes,int configuration_type){
    1313
    14         int i;
    15 
    16         /*intermediary: */
    17         int  numberofdofs;
     14        bool  oldalloc  = false;
    1815
    1916        /*output: */
     
    2118
    2219        /*figure out how many dofs we have: */
    23         numberofdofs=nodes->NumberOfDofs(configuration_type,SsetEnum);
     20        int ssize=nodes->NumberOfDofs(configuration_type,SsetEnum);
     21        int slocalsize = nodes->NumberOfDofsLocal(configuration_type,SsetEnum);
    2422
    2523        /*allocate:*/
    26         ys=new Vector<IssmDouble>(numberofdofs);
     24        if(oldalloc)
     25         ys=new Vector<IssmDouble>(ssize);
     26        else
     27         ys=new Vector<IssmDouble>(slocalsize,ssize);
    2728
    2829        /*go through all nodes, and for the ones corresponding to this configuration_type, fill the
    2930         * constraints vector with the constraint values: */
    30         for (i=0;i<nodes->Size();i++){
     31        for(int i=0;i<nodes->Size();i++){
    3132                Node* node=(Node*)nodes->GetObjectByOffset(i);
    3233                if (node->InAnalysis(configuration_type)){
  • issm/trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.cpp

    r13939 r13941  
    2020        int         global_m,global_n;
    2121        bool        fromlocalsize = true;
    22         bool        oldalloc  = true;
     22        bool        oldalloc  = false;
    2323
    2424        if(VerboseModule()) _pprintLine_("   Dirichlet lifting applied to load vector");
  • issm/trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp

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

    r13220 r13941  
    2121        ssize=nodes->NumberOfDofs(configuration_type,SsetEnum);
    2222
     23        int analysis_type;
     24        parameters->FindParam(&analysis_type,AnalysisTypeEnum);
     25        int slocalsize = nodes->NumberOfDofsLocal(analysis_type,SsetEnum);
     26
     27        bool oldalloc = false;
     28
    2329        if(ssize==0){
    2430                ys=NULL;
     
    2632        else{
    2733                /*allocate: */
    28                 ys=new Vector<IssmDouble>(ssize);
     34                if(oldalloc)
     35                 ys=new Vector<IssmDouble>(ssize);
     36                else
     37                 ys=new Vector<IssmDouble>(slocalsize,ssize);
    2938
    3039                if(nodes->NumberOfNodes(configuration_type)){
Note: See TracChangeset for help on using the changeset viewer.