本文整理汇总了C++中GaussPoint::s_coordinate方法的典型用法代码示例。如果您正苦于以下问题:C++ GaussPoint::s_coordinate方法的具体用法?C++ GaussPoint::s_coordinate怎么用?C++ GaussPoint::s_coordinate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GaussPoint
的用法示例。
在下文中一共展示了GaussPoint::s_coordinate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//! @brief Return the determinant of the jacobian at the position
//! being passed as parameters.
double XC::FourNodeQuad::shapeFunction(const GaussPoint &gp) const
{
const double &xi= gp.r_coordinate();
const double &eta= gp.s_coordinate();
const Vector &nd1Crds = theNodes[0]->getCrds();
const Vector &nd2Crds = theNodes[1]->getCrds();
const Vector &nd3Crds = theNodes[2]->getCrds();
const Vector &nd4Crds = theNodes[3]->getCrds();
const double oneMinuseta = 1.0-eta;
const double onePluseta = 1.0+eta;
const double oneMinusxi = 1.0-xi;
const double onePlusxi = 1.0+xi;
shp[2][0] = 0.25*oneMinusxi*oneMinuseta; // N_1
shp[2][1] = 0.25*onePlusxi*oneMinuseta; // N_2
shp[2][2] = 0.25*onePlusxi*onePluseta; // N_3
shp[2][3] = 0.25*oneMinusxi*onePluseta; // N_4
double J[2][2];
J[0][0] = 0.25 * (-nd1Crds(0)*oneMinuseta + nd2Crds(0)*oneMinuseta +
nd3Crds(0)*(onePluseta) - nd4Crds(0)*(onePluseta));
J[0][1] = 0.25 * (-nd1Crds(0)*oneMinusxi - nd2Crds(0)*onePlusxi +
nd3Crds(0)*onePlusxi + nd4Crds(0)*oneMinusxi);
J[1][0] = 0.25 * (-nd1Crds(1)*oneMinuseta + nd2Crds(1)*oneMinuseta +
nd3Crds(1)*onePluseta - nd4Crds(1)*onePluseta);
J[1][1] = 0.25 * (-nd1Crds(1)*oneMinusxi - nd2Crds(1)*onePlusxi +
nd3Crds(1)*onePlusxi + nd4Crds(1)*oneMinusxi);
const double detJ = J[0][0]*J[1][1] - J[0][1]*J[1][0];
const double oneOverdetJ = 1.0/detJ;
double L[2][2];
// L = inv(J)
L[0][0] = J[1][1]*oneOverdetJ;
L[1][0] = -J[0][1]*oneOverdetJ;
L[0][1] = -J[1][0]*oneOverdetJ;
L[1][1] = J[0][0]*oneOverdetJ;
double L00 = 0.25*L[0][0];
double L10 = 0.25*L[1][0];
double L01 = 0.25*L[0][1];
double L11 = 0.25*L[1][1];
double L00oneMinuseta = L00*oneMinuseta;
double L00onePluseta = L00*onePluseta;
double L01oneMinusxi = L01*oneMinusxi;
double L01onePlusxi = L01*onePlusxi;
double L10oneMinuseta = L10*oneMinuseta;
double L10onePluseta = L10*onePluseta;
double L11oneMinusxi = L11*oneMinusxi;
double L11onePlusxi = L11*onePlusxi;
// See Cook, Malkus, Plesha p. 169 for the derivation of these terms
shp[0][0] = -L00oneMinuseta - L01oneMinusxi; // N_1,1
shp[0][1] = L00oneMinuseta - L01onePlusxi; // N_2,1
shp[0][2] = L00onePluseta + L01onePlusxi; // N_3,1
shp[0][3] = -L00onePluseta + L01oneMinusxi; // N_4,1
shp[1][0] = -L10oneMinuseta - L11oneMinusxi; // N_1,2
shp[1][1] = L10oneMinuseta - L11onePlusxi; // N_2,2
shp[1][2] = L10onePluseta + L11onePlusxi; // N_3,2
shp[1][3] = -L10onePluseta + L11oneMinusxi; // N_4,2
return detJ;
}