53PatchIntegrationRule :: PatchIntegrationRule(
int n,
Element *e,
const std :: vector< Triangle > &iTriangles) :
58PatchIntegrationRule :: ~PatchIntegrationRule()
61FEI2dTrLin PatchIntegrationRule :: mTriInterp(1, 2);
65PatchIntegrationRule :: SetUpPointsOnTriangle(
int nPoints, MaterialMode mode)
86 for (
size_t i = 0; i <
mTriangles.size(); i++ ) {
90 std :: vector< int >triToKeep;
91 const double triTol = ( 1.0e-6 ) * totArea;
93 for (
size_t i = 0; i <
mTriangles.size(); i++ ) {
95 triToKeep.push_back(i);
99 int nPointsTot = nPoints * triToKeep.size();
106 std :: vector< FloatArray >newGPCoord;
108 double parentArea = this->
elem->computeArea();
111 for (
int tri: triToKeep ) {
113 std :: vector< FloatArray >coords(
mTriangles [ tri ].giveNrVertices() );
115 for (
int k = 1; k <=
mTriangles [ tri ].giveNrVertices(); k++ ) {
116 coords [ k - 1 ] =
mTriangles [ tri ].giveVertex(k);
122 for (
int j = 0; j < nPoints; j++ ) {
127 Vec2(coords_xi1.
at(j + 1), coords_xi2.
at(j + 1)),
128 weights.
at(j + 1), mode);
135 newGPCoord.push_back(global);
139 this->
elem->computeLocalCoordinates(local, global);
148 double refElArea = this->
elem->giveParentElSize();
176 int elIndex = this->
elem->giveGlobalNumber();
177 std :: stringstream str;
178 str <<
"GaussPointsTime" << time <<
"El" << elIndex <<
".vtk";
179 std :: string name = str.str();
181 XFEMDebugTools :: WritePointsToVTK(name, newGPCoord);
192PatchIntegrationRule :: SetUpPointsOnWedge(
int nPointsTri,
int nPointsDepth, MaterialMode mode)
200 double totArea = 0.0;
201 for (
size_t i = 0; i <
mTriangles.size(); i++ ) {
205 std :: vector< int >triToKeep;
206 const double triTol = ( 1.0e-6 ) * totArea;
208 for (
size_t i = 0; i <
mTriangles.size(); i++ ) {
210 triToKeep.push_back(i);
214 int nPointsTot = nPointsTri * nPointsDepth * triToKeep.size();
215 FloatArray coords_xi1, coords_xi2, coords_xi3, weightsTri, weightsDepth;
220 std :: vector< FloatArray >newGPCoord;
222 double parentArea = this->
elem->computeArea();
226 for (
int i = 0; i < int( triToKeep.size() ); i++ ) {
232 gCoords [ j ] = ( triangle.
giveVertex(j + 1) );
236 for (
int k = 1; k <= nPointsTri; k++ ) {
237 for (
int m = 1; m <= nPointsDepth; m++ ) {
240 double refElArea = 0.5;
241 double oldWeight = weightsTri.
at(k) * weightsDepth.
at(m);
242 double newWeight = 2.0 * refElArea * oldWeight * triangle.
getArea() / parentArea;
245 Vec3(coords_xi1.
at(k), coords_xi2.
at(k), coords_xi3.
at(m)),
259 this->
elem->computeLocalCoordinates(local, global);
260 local.
at(3) = coords_xi3.
at(m);
262 this->
elem->computeGlobalCoordinates(global, local);
269 newGPCoord.push_back(global);
293 int elIndex = this->
elem->giveGlobalNumber();
294 std :: stringstream str;
295 str <<
"GaussPointsTime" << time <<
"El" << elIndex <<
".vtk";
296 std :: string name = str.str();
298 XFEMDebugTools :: WritePointsToVTK(name, newGPCoord);
311 IntegrationRule :: saveContext(stream, mode);
317 int _type = this->patch->givePatchType();
318 if ( !stream.
write(_type) ) {
321 patch->saveContext(stream, mode);
332 IntegrationRule :: restoreContext(stream, mode);
335 if ( !stream.
read(_ptype) ) {
const FloatArray & giveVertex(int n) const
int giveNrVertices() const
Returns number of Geometry vertices.
virtual int read(int *data, std::size_t count)=0
Reads count integer values into array pointed by data.
virtual int write(const int *data, std::size_t count)=0
Writes count integer values from array pointed by data.
EngngModel * giveEngngModel()
virtual TimeStep * giveCurrentStep(bool force=false)
Domain * giveDomain() const
static void giveTriCoordsAndWeights(int nPoints, FloatArray &coords_xi1, FloatArray &coords_xi2, FloatArray &weights)
GaussIntegrationRule(int n, Element *e, int startIndx, int endIndx, bool dynamic=false)
static void giveLineCoordsAndWeights(int nPoints, FloatArray &coords_xi, FloatArray &weights)
void setNaturalCoordinates(const FloatArray &c)
const FloatArray & giveNaturalCoordinates() const
Returns coordinate array of receiver.
void setSubPatchCoordinates(const FloatArray &c)
double giveWeight()
Returns integration weight of receiver.
void setGlobalCoordinates(const FloatArray &iCoord)
Element * elem
Element which integration rule is coupled to.
int giveNumberOfIntegrationPoints() const
std::vector< GaussPoint * > gaussPoints
Array containing integration points.
static FEI2dTrLin mTriInterp
std ::vector< Triangle > mTriangles
double giveTargetTime()
Returns target time.
bool giveVtkDebug() const
static FloatArray Vec2(const double &a, const double &b)
@ CIO_IOERR
General IO error.
static FloatArray Vec3(const double &a, const double &b, const double &c)