Changeset 5669


Ignore:
Timestamp:
09/03/10 10:47:10 (15 years ago)
Author:
Mathieu Morlighem
Message:

Some more cleaning

Location:
issm/trunk/src/c/objects/Elements
Files:
2 edited

Legend:

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

    r5663 r5669  
    11081108void  Tria::GradjDhDt(Vec gradient){
    11091109
    1110         int i;
    1111 
    1112         /* node data: */
    1113         int          doflist1[NUMVERTICES];
    1114 
    1115         /*Gauss*/
    1116         double  gauss[NUMVERTICES][NUMVERTICES]={{1,0,0},{0,1,0},{0,0,1}};
    1117 
    1118         /* grid data: */
    1119         double lambda;
    1120 
    1121         /*element vector at the gaussian points: */
    1122         double  gradient_g[NUMVERTICES];
    1123 
    1124         /*Inputs*/
    1125         Input* adjoint_input=NULL;
     1110        /*Intermediaries*/
     1111        int    doflist1[NUMVERTICES];
     1112        double lambda[NUMVERTICES];
     1113        double gradient_g[NUMVERTICES];
    11261114
    11271115        /*Retrieve dof list*/
    11281116        GetDofList1(&doflist1[0]);
    11291117
    1130         /*Retrieve all inputs we will be needing: */
    1131         adjoint_input=(Input*)inputs->GetInput(AdjointEnum);
    1132 
    1133         /* Start  looping on the vertices: */
    1134         for(i=0; i<NUMVERTICES;i++){
    1135                 adjoint_input->GetParameterValue(&lambda,&gauss[i][0]);
    1136                 gradient_g[i]=-lambda;
    1137         }
     1118        /*Compute Gradient*/
     1119        GetParameterListOnVertices(&lambda[0],AdjointEnum);
     1120        for(int i=0;i<NUMVERTICES;i++) gradient_g[i]=-lambda[i];
    11381121
    11391122        /*Add grade_g to global vector gradient: */
     
    57935776}
    57945777/*}}}*/
    5795 /*FUNCTION Tria::GetStrainRate2d(double* epsilon,double* xyz_list, double* gauss, Input* vx_input, Input* vy_input){{{1*/
    5796 void Tria::GetStrainRate2d(double* epsilon,double* xyz_list, double* gauss, Input* vx_input, Input* vy_input){
    5797         /*Compute the 2d Strain Rate (3 components):
    5798          *
    5799          * epsilon=[exx eyy exy]
    5800          */
    5801 
    5802         int i;
    5803 
    5804         double epsilonvx[3];
    5805         double epsilonvy[3];
    5806 
    5807         /*Check that both inputs have been found*/
    5808         if (!vx_input || !vy_input){
    5809                 ISSMERROR("Input missing. Here are the input pointers we have for vx: %p, vy: %p\n",vx_input,vy_input);
    5810         }
    5811 
    5812         /*Get strain rate assuming that epsilon has been allocated*/
    5813         vx_input->GetVxStrainRate2d(epsilonvx,xyz_list,gauss);
    5814         vy_input->GetVyStrainRate2d(epsilonvy,xyz_list,gauss);
    5815 
    5816         /*Sum all contributions*/
    5817         for(i=0;i<3;i++) epsilon[i]=epsilonvx[i]+epsilonvy[i];
    5818 
    5819 }
    5820 /*}}}*/
    58215778/*FUNCTION Tria::GetStrainRate2d(double* epsilon,double* xyz_list, GaussTria* gauss, Input* vx_input, Input* vy_input){{{1*/
    58225779void Tria::GetStrainRate2d(double* epsilon,double* xyz_list, GaussTria* gauss, Input* vx_input, Input* vy_input){
  • issm/trunk/src/c/objects/Elements/Tria.h

    r5662 r5669  
    158158                void      GetSolutionFromInputsDiagnosticHoriz(Vec solution);
    159159                void      GetSolutionFromInputsDiagnosticHutter(Vec solution);
    160                 void    GetStrainRate2d(double* epsilon,double* xyz_list, double* gauss, Input* vx_input, Input* vy_input);
    161160                void    GetStrainRate2d(double* epsilon,double* xyz_list, GaussTria* gauss, Input* vx_input, Input* vy_input);
    162161                void      GradjDragStokes(Vec gradient);
Note: See TracChangeset for help on using the changeset viewer.