Ignore:
Timestamp:
07/30/10 09:00:31 (15 years ago)
Author:
Mathieu Morlighem
Message:

Use Matrix utils to compute determinant and matrix invert. Simple routines for 2x2 and 3x3 matrices have been added (speeds up)

File:
1 edited

Legend:

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

    r4885 r4898  
    40144014}
    40154015/*}}}*/
    4016 /*FUNCTION Penta::GetMatrixInvert {{{1*/
    4017 void Penta::GetMatrixInvert(double*  Ke_invert, double* Ke){
    4018         /*Inverse a 3 by 3 matrix only */
    4019 
    4020         double a,b,c,d,e,f,g,h,i;
    4021         double det;
    4022         int calculationdof=3;
    4023 
    4024         /*Take the matrix components: */
    4025         a=*(Ke+calculationdof*0+0);
    4026         b=*(Ke+calculationdof*0+1);
    4027         c=*(Ke+calculationdof*0+2);
    4028         d=*(Ke+calculationdof*1+0);
    4029         e=*(Ke+calculationdof*1+1);
    4030         f=*(Ke+calculationdof*1+2);
    4031         g=*(Ke+calculationdof*2+0);
    4032         h=*(Ke+calculationdof*2+1);
    4033         i=*(Ke+calculationdof*2+2);
    4034 
    4035         det=a*(e*i-f*h)-b*(d*i-f*g)+c*(d*h-e*g);
    4036 
    4037         *(Ke_invert+calculationdof*0+0)=(e*i-f*h)/det;
    4038         *(Ke_invert+calculationdof*0+1)=(c*h-b*i)/det;
    4039         *(Ke_invert+calculationdof*0+2)=(b*f-c*e)/det;
    4040         *(Ke_invert+calculationdof*1+0)=(f*g-d*i)/det;
    4041         *(Ke_invert+calculationdof*1+1)=(a*i-c*g)/det;
    4042         *(Ke_invert+calculationdof*1+2)=(c*d-a*f)/det;
    4043         *(Ke_invert+calculationdof*2+0)=(d*h-e*g)/det;
    4044         *(Ke_invert+calculationdof*2+1)=(b*g-a*h)/det;
    4045         *(Ke_invert+calculationdof*2+2)=(a*e-b*d)/det;
    4046 
    4047 }
    4048 /*}}}*/
    40494016/*FUNCTION Penta::GetParameterValue(double* pvalue, double* v_list,double* gauss_coord) {{{1*/
    40504017void Penta::GetParameterValue(double* pvalue, double* v_list,double* gauss_coord){
     
    51865153
    51875154        /*Inverse the matrix corresponding to bubble part Kbb */
    5188         GetMatrixInvert(&Kbbinv[0][0], &Kbb[0][0]);
     5155        Matrix3x3Invert(&Kbbinv[0][0], &Kbb[0][0]);
    51895156
    51905157        /*Multiply matrices to create the reduce matrix Ke_reduced */
     
    52305197
    52315198        /*Inverse the matrix corresponding to bubble part Kbb */
    5232         GetMatrixInvert(&Kbbinv[0][0], &Kbb[0][0]);
     5199        Matrix3x3Invert(&Kbbinv[0][0], &Kbb[0][0]);
    52335200
    52345201        /*Multiply matrices to create the reduce matrix Ke_reduced */
Note: See TracChangeset for help on using the changeset viewer.