Changeset 4990


Ignore:
Timestamp:
08/04/10 16:36:54 (15 years ago)
Author:
Mathieu Morlighem
Message:

Now SpawnTria also Sawn matice->inputs

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

Legend:

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

    r4983 r4990  
    703703                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face).
    704704                J=tria->CostFunction(process_units);
    705                 delete tria;
     705                delete tria->matice; delete tria;
    706706
    707707                /*delete B average*/
     
    717717                tria=(Tria*)SpawnTria(3,4,5); //grids 3, 4 and 5 make the new tria (upper face).
    718718                J=tria->CostFunction(process_units);
    719                 delete tria;
     719                delete tria->matice; delete tria;
    720720
    721721                /*delete B average*/
     
    15771577                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face).
    15781578                J=tria->Misfit(process_units);
    1579                 delete tria;
     1579                delete tria->matice; delete tria;
    15801580                return J;
    15811581        }
     
    15841584                tria=(Tria*)SpawnTria(3,4,5); //grids 3, 4 and 5 make the new tria (upper face).
    15851585                J=tria->Misfit(process_units);
    1586                 delete tria;
     1586                delete tria->matice; delete tria;
    15871587                return J;
    15881588        }
     
    17121712                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face).
    17131713                S=tria->SurfaceArea();
    1714                 delete tria;
     1714                delete tria->matice; delete tria;
    17151715                return S;
    17161716        }
     
    17191719                tria=(Tria*)SpawnTria(3,4,5); //grids 3, 4 and 5 make the new tria (upper face).
    17201720                S=tria->SurfaceArea();
    1721                 delete tria;
     1721                delete tria->matice; delete tria;
    17221722                return S;
    17231723        }
     
    19821982        tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    19831983        tria->CreateKMatrix(Kgg);
    1984         delete tria;
     1984        delete tria->matice; delete tria;
    19851985
    19861986        /*Delete Vx and Vy averaged*/
     
    20202020        tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    20212021        tria->CreateKMatrix(Kgg);
    2022         delete tria;
     2022        delete tria->matice; delete tria;
    20232023
    20242024        /*Delete Vx and Vy averaged*/
     
    21512151                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    21522152                tria->CreateKMatrix(Kgg);
    2153                 delete tria;
     2153                delete tria->matice; delete tria;
    21542154
    21552155                /*Delete B averaged*/
     
    22512251                        tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    22522252                        tria->CreateKMatrixDiagnosticHorizFriction(Kgg);
    2253                         delete tria;
     2253                        delete tria->matice; delete tria;
    22542254                }
    22552255
     
    26892689                tria=(Tria*)SpawnTria(3,4,5); //nodes 3,4 and 5 are on the surface
    26902690                tria->CreateKMatrixDiagnosticSurfaceVert(Kgg);
    2691                 delete tria;
     2691                delete tria->matice; delete tria;
    26922692        }
    26932693
     
    27802780                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    27812781                tria->CreateKMatrixMelting(Kgg);
    2782                 delete tria;
     2782                delete tria->matice; delete tria;
    27832783                return;
    27842784        }
     
    28122812        tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    28132813        tria->CreateKMatrix(Kgg);
    2814         delete tria;
     2814        delete tria->matice; delete tria;
    28152815
    28162816        /*Delete Vx and Vy averaged*/
     
    28462846        tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    28472847        tria->CreateKMatrix(Kgg);
    2848         delete tria;
     2848        delete tria->matice; delete tria;
    28492849        return;
    28502850
     
    30923092                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    30933093                tria->CreateKMatrixThermal(Kgg);
    3094                 delete tria;
     3094                delete tria->matice; delete tria;
    30953095        }
    30963096}
     
    31233123        tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    31243124        tria->CreatePVector(pg);
    3125         delete tria;
     3125        delete tria->matice; delete tria;
    31263126
    31273127        /*Delete Vx and Vy averaged*/
     
    31593159        tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    31603160        tria->CreatePVector(pg);
    3161         delete tria;
     3161        delete tria->matice; delete tria;
    31623162
    31633163        /*Delete Vx and Vy averaged*/
     
    32453245                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    32463246                tria->CreatePVector(pg);
    3247                 delete tria;
     3247                delete tria->matice; delete tria;
    32483248                return;
    32493249        }
     
    33553355                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face).
    33563356                tria->CreatePVectorAdjointHoriz(p_g);
    3357                 delete tria;
     3357                delete tria->matice; delete tria;
    33583358                return;
    33593359        }
     
    33623362                tria=(Tria*)SpawnTria(3,4,5); //grids 3, 4 and 5 make the new tria (upper face).
    33633363                tria->CreatePVectorAdjointHoriz(p_g);
    3364                 delete tria;
     3364                delete tria->matice; delete tria;
    33653365                return;
    33663366        }
     
    37933793        tria=(Tria*)SpawnTria(3,4,5); //grids 3, 4 and 5 make the new tria (upper face).
    37943794        tria->CreatePVectorAdjointStokes(p_g);
    3795         delete tria;
     3795        delete tria->matice; delete tria;
    37963796        return;
    37973797}
     
    38623862                tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 are on the bedrock
    38633863                tria->CreatePVectorDiagnosticBaseVert(pg);
    3864                 delete tria;
     3864                delete tria->matice; delete tria;
    38653865        }
    38663866
     
    39613961        tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    39623962        tria->CreatePVector(pg);
    3963         delete tria;
     3963        delete tria->matice; delete tria;
    39643964
    39653965        /*Delete Vx and Vy averaged*/
     
    39933993        tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    39943994        tria->CreatePVector(pg);
    3995         delete tria;
     3995        delete tria->matice; delete tria;
    39963996        return;
    39973997}
     
    41664166                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    41674167                tria->CreatePVectorThermalShelf(pg);
    4168                 delete tria;
     4168                delete tria->matice; delete tria;
    41694169        }
    41704170
     
    41744174                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    41754175                tria->CreatePVectorThermalSheet(pg);
    4176                 delete tria;
     4176                delete tria->matice; delete tria;
    41774177        }
    41784178
     
    47024702                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face).
    47034703                tria->GradjB(gradient);
    4704                 delete tria;
     4704                delete tria->matice; delete tria;
    47054705
    47064706                /*delete B average*/
     
    47144714                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face).
    47154715                tria->GradjB(gradient);
    4716                 delete tria;
     4716                delete tria->matice; delete tria;
    47174717
    47184718                /*delete B average*/
     
    47584758                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    47594759                tria->GradjDrag(gradient);
    4760                 delete tria;
     4760                delete tria->matice; delete tria;
    47614761        }
    47624762        else if (analysis_type==AdjointStokesAnalysisEnum){
     
    47654765                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
    47664766                tria->GradjDragStokes(gradient);
    4767                 delete tria;
     4767                delete tria->matice; delete tria;
    47684768        }
    47694769        else ISSMERROR("analysis %s not supported yet",EnumAsString(analysis_type));
     
    55955595        tria->results=tria_results;
    55965596        tria->parameters=tria_parameters;
    5597         tria->element_type=P1Enum; //Only P1 CG for now
     5597        tria->element_type=P1Enum; //Only P1 CG for now (TO BE CHANGED)
    55985598        this->SpawnTriaHook(dynamic_cast<TriaHook*>(tria),&indices[0]);
     5599
     5600        /*Spawn matice*/
     5601        tria->matice=NULL;
     5602        tria->matice=(Matice*)this->matice->copy();
     5603        delete tria->matice->inputs;
     5604        tria->matice->inputs=(Inputs*)this->matice->inputs->SpawnTriaInputs(indices);
    55995605
    56005606        /*recover nodes, matice and matpar: */
    56015607        tria->nodes=(Node**)tria->hnodes[analysis_counter]->deliverp();
    5602         tria->matice=(Matice*)tria->hmatice->delivers();
    56035608        tria->matpar=(Matpar*)tria->hmatpar->delivers();
    56045609       
  • issm/trunk/src/c/objects/Elements/PentaHook.cpp

    r4546 r4990  
    9292                }
    9393        }
    94         triahook->hmatice=(Hook*)this->hmatice->copy();
     94        // do not spawn hmatice. matice will be taken care of by Penta
     95        triahook->hmatice=NULL;
    9596        triahook->hmatpar=(Hook*)this->hmatpar->copy();
    9697}
  • issm/trunk/src/c/objects/Elements/PentaRef.cpp

    r4921 r4990  
    871871        double A1,A2,A3,z;
    872872
    873         A1=gauss[0]; //first area coordinate value. In term of xi and eta: A1=(1-xi)/2-eta/(2*SQRT3);
    874         A2=gauss[1]; //second area coordinate value In term of xi and eta: A2=(1+xi)/2-eta/(2*SQRT3);
    875         A3=gauss[2]; //third area coordinate value  In term of xi and eta: A3=y/SQRT3;
    876         z=gauss[3]; //fourth vertical coordinate value. Corresponding nodal function: (1-z)/2 and (1+z)/2
    877 
     873        A1=gauss[0]; ISSMASSERT(A1>=0 && A1<=1);//first area coordinate value. In term of xi and eta: A1=(1-xi)/2-eta/(2*SQRT3);
     874        A2=gauss[1]; ISSMASSERT(A2>=0 && A2<=1);//second area coordinate value In term of xi and eta: A2=(1+xi)/2-eta/(2*SQRT3);
     875        A3=gauss[2]; ISSMASSERT(A3>=0 && A3<=1);//third area coordinate value  In term of xi and eta: A3=y/SQRT3;
     876        z=gauss[3];  ISSMASSERT(z>=-1 &&  z<=1);//fourth vertical coordinate value. Corresponding nodal function: (1-z)/2 and (1+z)/2
    878877
    879878        /*First nodal function derivatives. The corresponding nodal function is N=A1*(1-z)/2. Its derivatives follow*/
  • issm/trunk/src/c/objects/Materials/Matice.cpp

    r4978 r4990  
    220220        Matice* matice=NULL;
    221221
     222        /*Initialize output*/
     223        matice=new Matice();
     224
    222225        /*copy fields: */
    223226        matice->mid=this->mid;
Note: See TracChangeset for help on using the changeset viewer.