本文整理汇总了C++中GaussPoint::setSubPatchCoordinates方法的典型用法代码示例。如果您正苦于以下问题:C++ GaussPoint::setSubPatchCoordinates方法的具体用法?C++ GaussPoint::setSubPatchCoordinates怎么用?C++ GaussPoint::setSubPatchCoordinates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GaussPoint
的用法示例。
在下文中一共展示了GaussPoint::setSubPatchCoordinates方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetUpPointsOnWedge
int
PatchIntegrationRule :: SetUpPointsOnWedge(int nPointsTri, int nPointsDepth, MaterialMode mode)
{
//int pointsPassed = 0;
// TODO: set properly
firstLocalStrainIndx = 1;
lastLocalStrainIndx = 3;
double totArea = 0.0;
for ( size_t i = 0; i < mTriangles.size(); i++ ) {
totArea += mTriangles [ i ].getArea();
}
std :: vector< int >triToKeep;
const double triTol = ( 1.0e-6 ) * totArea;
for ( size_t i = 0; i < mTriangles.size(); i++ ) {
if ( mTriangles [ i ].getArea() > triTol ) {
triToKeep.push_back(i);
}
}
int nPointsTot = nPointsTri * nPointsDepth * triToKeep.size();
FloatArray coords_xi1, coords_xi2, coords_xi3, weightsTri, weightsDepth;
this->giveTriCoordsAndWeights(nPointsTri, coords_xi1, coords_xi2, weightsTri);
this->giveLineCoordsAndWeights(nPointsDepth, coords_xi3, weightsDepth);
this->gaussPoints.resize(nPointsTot);
std :: vector< FloatArray >newGPCoord;
double parentArea = this->elem->computeArea();
int count = 0;
// Loop over triangles
for ( int i = 0; i < int( triToKeep.size() ); i++ ) {
Triangle triangle = mTriangles [ triToKeep [ i ] ];
// global coords of the the triangle verticies
std::vector< FloatArray > gCoords( triangle.giveNrVertices() );
for ( int j = 0; j < triangle.giveNrVertices(); j++ ) {
gCoords[j] = (triangle.giveVertex(j + 1));
}
for ( int k = 1; k <= nPointsTri; k++ ) {
for ( int m = 1; m <= nPointsDepth; m++ ) {
// local coords in the parent triangle
FloatArray *lCoords = new FloatArray(3);
lCoords->at(1) = coords_xi1.at(k);
lCoords->at(2) = coords_xi2.at(k);
lCoords->at(3) = coords_xi3.at(m);
double refElArea = 0.5;
double oldWeight = weightsTri.at(k) * weightsDepth.at(m);
double newWeight = 2.0 * refElArea * oldWeight * triangle.getArea() / parentArea;
GaussPoint *gp = new GaussPoint(this, count + 1, lCoords, newWeight, mode);
this->gaussPoints[count] = gp;
count++;
// Compute global gp coordinate in the element from local gp coord in the sub triangle
FloatArray global;
mTriInterp.local2global( global, * gp->giveNaturalCoordinates(),
FEIVertexListGeometryWrapper(gCoords) );
// Compute local gp coordinate in the element from global gp coord in the element
FloatArray local;
this->elem->computeLocalCoordinates(local, global);
local.at(3) = coords_xi3.at(m); // manually set third coordinate
// compute global coords again, since interpolator dosn't give the z-coord
this->elem->computeGlobalCoordinates(global, local);
gp->setGlobalCoordinates(global);
gp->setNaturalCoordinates(local);
gp->setSubPatchCoordinates(local);
// Store new global gp coord for vtk output
newGPCoord.push_back(global);
}
}
//for ( int k = 0; k < mTriangles [ triToKeep [ i ] ].giveNrVertices(); k++ ) {
// delete gCoords [ k ];
//}
//delete [] gCoords;
}
XfemManager *xMan = elem->giveDomain()->giveXfemManager();
if ( xMan != NULL ) {
if ( xMan->giveVtkDebug() ) {
double time = 0.0;
Element *el = this->elem;
if ( el != NULL ) {
//.........这里部分代码省略.........