00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <math.h>
00026
00027 #include <stdlib.h>
00028 #include <Vector.h>
00029 #include <MatrixUtil.h>
00030
00031
00032 double invert2by2Matrix(const Matrix &a, Matrix &b)
00033 {
00034 return a.Invert(b);
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 }
00048
00049
00050
00051 double invert3by3Matrix(const Matrix &a, Matrix &b)
00052 {
00053 return a.Invert(b);
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087 }
00088
00089
00090
00091
00092 void invertMatrix(int n, const Matrix &a, Matrix &b)
00093 {
00094 a.Invert(b);
00095 }
00096
00097
00098
00099 void getCBDIinfluenceMatrix(int nIntegrPts, const Matrix &xi_pt, double L, Matrix &ls)
00100 {
00101
00102 int i, j, i0, j0;
00103 double xi;
00104 Matrix G(nIntegrPts, nIntegrPts);
00105 Matrix Ginv(nIntegrPts, nIntegrPts);
00106 Matrix l(nIntegrPts, nIntegrPts);
00107 Matrix I(nIntegrPts,nIntegrPts);
00108
00109 for (i = 1; i <= nIntegrPts; i++)
00110 for (j = 1; j <= nIntegrPts; j++)
00111 {
00112 i0 = i - 1;
00113 j0 = j - 1;
00114 xi = xi_pt(i0,0);
00115 G(i0,j0) = pow(xi,j-1);
00116 l(i0,j0) = (pow(xi,j+1)-xi)/(j*(j+1));
00117 }
00118
00119 I.Zero();
00120 for (i=0; i<nIntegrPts; i++)
00121 I(i,i) = 1.0;
00122
00123
00124 if (G.Solve(I,Ginv) < 0)
00125 opserr << "LargeDispBeamCol3d::getCBDIinfluenceMatrix() - could not invert G\n";
00126
00127
00128 ls.addMatrixProduct(0.0, l, Ginv, L*L);
00129 }
00130
00131 void getCBDIinfluenceMatrix(int nIntegrPts, double *pts, double L, Matrix &ls)
00132 {
00133
00134 int i, j, i0, j0;
00135 double xi;
00136 Matrix G(nIntegrPts, nIntegrPts);
00137 Matrix Ginv(nIntegrPts, nIntegrPts);
00138 Matrix l(nIntegrPts, nIntegrPts);
00139 Matrix I(nIntegrPts,nIntegrPts);
00140
00141 for (i = 1; i <= nIntegrPts; i++)
00142 for (j = 1; j <= nIntegrPts; j++)
00143 {
00144 i0 = i - 1;
00145 j0 = j - 1;
00146 xi = pts[i0];
00147 G(i0,j0) = pow(xi,j-1);
00148 l(i0,j0) = (pow(xi,j+1)-xi)/(j*(j+1));
00149 }
00150
00151 I.Zero();
00152 for (i=0; i<nIntegrPts; i++)
00153 I(i,i) = 1.0;
00154
00155
00156 if (G.Solve(I,Ginv) < 0)
00157 opserr << "LargeDispBeamCol3d::getCBDIinfluenceMatrix() - could not invert G\n";
00158
00159
00160 ls.addMatrixProduct(0.0, l, Ginv, L*L);
00161 }
00162
00163
00164
00165
00166