https://mooseframework.inl.gov
Loading...
Searching...
No Matches
XFEMFuncs.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include <vector>
13#include "libmesh/point.h"
14#include "libmesh/plane.h"
15#include "EFAPoint.h"
16
17using libMesh::Plane;
18using libMesh::Point;
19using libMesh::Real;
20
21namespace Xfem
22{
23static const double tol = 1.0e-10;
24
25void dunavant_rule2(const Real * wts,
26 const Real * a,
27 const Real * b,
28 const unsigned int * permutation_ids,
29 unsigned int n_wts,
30 std::vector<Point> & points,
31 std::vector<Real> & weights);
32
33void stdQuadr2D(unsigned int nen, unsigned int iord, std::vector<std::vector<Real>> & sg2);
34
35void wissmannPoints(unsigned int nqp, std::vector<std::vector<Real>> & wss);
36
37void shapeFunc2D(unsigned int nen,
38 std::vector<Real> & ss,
39 std::vector<Point> & xl,
40 std::vector<std::vector<Real>> & shp,
41 Real & xsj,
42 bool natl_flg);
43
44double r8vec_norm(int n, double a[]);
45
46void r8vec_copy(int n, double a1[], double a2[]);
47
48bool r8vec_eq(int n, double a1[], double a2[]);
49
50double r8vec_dot_product(int n, double a1[], double a2[]);
51
52bool line_exp_is_degenerate_nd(int dim_num, double p1[], double p2[]);
53
55 double pp[3], double normal[3], double p1[3], double p2[3], double pint[3]);
56
58 double coord[], int order_max, int face_num, int node[], int node_num, int order[]);
59
60void i4vec_zero(int n, int a[]);
61
63
65
66double r8_acos(double c);
67
68double angle_rad_3d(double p1[3], double p2[3], double p3[3]);
69
83bool intersectSegmentWithCutLine(const Point & segment_point1,
84 const Point & segment_point2,
85 const std::pair<Point, Point> & cutting_line_points,
86 const Real & cutting_line_fraction,
87 Real & segment_intersection_fraction);
88
98Real crossProduct2D(const Point & point_a, const Point & point_b);
99
108Real pointSegmentDistance(const Point & x0, const Point & x1, const Point & x2, Point & xp);
109
120// See "Generating Signed Distance Fields From Triangle Meshes" for details.
121// (http://www2.imm.dtu.dk/pubdb/edoc/imm1289.pdf)
122//
123// R1
124// 1
125// * *
126// R4 * * R6
127// * R0 *
128// * *
129// 2 * * * * 3
130// R2 R5 R3
131
133 const Point & x1,
134 const Point & x2,
135 const Point & x3,
136 Point & xp,
137 unsigned int & region);
138
147bool intersectWithEdge(const Point & p1,
148 const Point & p2,
149 const std::vector<Point> & vertices,
150 Point & pint);
151
158bool isInsideEdge(const Point & p1, const Point & p2, const Point & p);
159
166Real getRelativePosition(const Point & p1, const Point & p2, const Point & p);
167
174bool isInsideCutPlane(const std::vector<Point> & vertices, const Point & p);
175
176} // namespace Xfem
const Real p
Definition XFEM.h:26
void i4vec_zero(int n, int a[])
Definition XFEMFuncs.C:584
double polyhedron_volume_3d(double coord[], int order_max, int face_num, int node[], int node_num, int order[])
Definition XFEMFuncs.C:487
double angle_rad_3d(double p1[3], double p2[3], double p3[3])
Definition XFEMFuncs.C:689
void wissmannPoints(unsigned int nqp, std::vector< std::vector< Real > > &wss)
Definition XFEMFuncs.C:231
double r8_acos(double c)
Definition XFEMFuncs.C:637
bool intersectSegmentWithCutLine(const Point &segment_point1, const Point &segment_point2, const std::pair< Point, Point > &cutting_line_points, const Real &cutting_line_fraction, Real &segment_intersection_fraction)
Determine whether a line segment is intersected by a cutting line, and compute the fraction along tha...
Real crossProduct2D(const Point &point_a, const Point &point_b)
Compute the cross product of two vectors, provided as Point objects, which have nonzero components on...
void stdQuadr2D(unsigned int nen, unsigned int iord, std::vector< std::vector< Real > > &sg2)
Definition XFEMFuncs.C:94
Real getRelativePosition(const Point &p1, const Point &p2, const Point &p)
Get the relative position of p from p1 respect to the total length of the line segment.
bool intersectWithEdge(const Point &p1, const Point &p2, const std::vector< Point > &vertices, Point &pint)
check if a line intersects with an element defined by vertices calculate the distance from a point to...
void shapeFunc2D(unsigned int nen, std::vector< Real > &ss, std::vector< Point > &xl, std::vector< std::vector< Real > > &shp, Real &xsj, bool natl_flg)
double r8vec_norm(int n, double a[])
Definition XFEMFuncs.C:352
void dunavant_rule2(const Real *wts, const Real *a, const Real *b, const unsigned int *permutation_ids, unsigned int n_wts, std::vector< Point > &points, std::vector< Real > &weights)
bool r8vec_eq(int n, double a1[], double a2[])
Definition XFEMFuncs.C:372
int plane_normal_line_exp_int_3d(double pp[3], double normal[3], double p1[3], double p2[3], double pint[3])
Definition XFEMFuncs.C:401
bool isInsideEdge(const Point &p1, const Point &p2, const Point &p)
check if point is inside the straight edge p1-p2
double r8vec_dot_product(int n, double a1[], double a2[])
Definition XFEMFuncs.C:382
bool line_exp_is_degenerate_nd(int dim_num, double p1[], double p2[])
Definition XFEMFuncs.C:392
bool isInsideCutPlane(const std::vector< Point > &vertices, const Point &p)
Check if point p is inside a plane.
Real pointSegmentDistance(const Point &x0, const Point &x1, const Point &x2, Point &xp)
Calculate the signed distance from a point to a line segment.
Real pointTriangleDistance(const Point &x0, const Point &x1, const Point &x2, const Point &x3, Point &xp, unsigned int &region)
Calculate the signed distance from a point to a triangle.
void normalizePoint(Point &p)
static const double tol
Definition XFEMFuncs.h:23
void r8vec_copy(int n, double a1[], double a2[])
Definition XFEMFuncs.C:363
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real