gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
7 #include "GmshConfig.h"
15 #if defined(HAVE_MESH)
21 :
GEdge(model, num, _v0, _v1)
49 double tmin =
_pars[iLine];
50 double tmax =
_pars[iLine + 1];
51 if(t >= tmin && t <= tmax) {
52 tLoc = (t - tmin) / (tmax - tmin);
70 SPoint3 v = vB + (vE - vB) * tLoc;
71 return GPoint(v.
x(), v.
y(), v.
z(),
this, par);
85 dx = (vE.
x() - vB.
x());
86 dy = (vE.
y() - vB.
y());
87 dz = (vE.
z() - vB.
z());
114 int iEdgePlus = iEdge + 1, iEdgeMinus = iEdge - 1;
136 double B =
c.distance(a);
142 A * B * C / sqrt((A + B + C) * (-A + B + C) * (A - B + C) * (A + B - C));
144 return R = 0.0 ? 1.E22 : 1. / R;
154 if(
lines.empty())
return 0;
162 for(std::size_t i = 0; i <
lines.size(); i++) {
174 std::vector<MEdge> allEdges;
175 for(std::size_t i = 0; i <
lines.size(); i++) {
176 allEdges.push_back(
MEdge(
lines[i]->getVertex(0),
lines[i]->getVertex(1)));
178 std::vector<std::vector<MVertex *> > vs;
180 if(vs.size() == 1) {
vertices = vs[0]; }
205 for(std::size_t i = 0; i <
vertices.size(); i++) {
208 _pars.push_back((
double)i);
216 #if defined(HAVE_MESH)
226 if(N !=
_pars.size()) {
227 Msg::Error(
"Wrong number of parameters in STL mesh of curve %d",
tag());
231 fwrite(&N,
sizeof(std::size_t), 1, fp);
232 std::vector<double> d(4 * N);
233 for(std::size_t i = 0; i < N; i++) {
237 d[4 * i + 3] =
_pars[i];
239 fwrite(&d[0],
sizeof(
double), 4 * N, fp);
242 fprintf(fp,
"%lu\n", N);
243 for(std::size_t i = 0; i < N; i++) {
255 if(fread(&N,
sizeof(std::size_t), 1, fp) != 1) {
return false; }
258 if(fscanf(fp,
"%lu", &N) != 1) {
return false; }
263 std::vector<double> d(4 * N);
265 if(fread(&d[0],
sizeof(
double), 4 * N, fp) != 4 * N) {
return false; }
268 for(std::size_t i = 0; i < N; i++) {
269 if(fscanf(fp,
"%lf %lf %lf %lf", &d[4 * i + 0], &d[4 * i + 1],
270 &d[4 * i + 2], &d[4 * i + 3]) != 4) {
276 for(std::size_t i = 0; i < N; i++) {
278 _pars[i] = d[4 * i + 3];
#define MSH_SEGM_DISCRETE
virtual GPoint point(double p) const
virtual bool periodic(int dim) const
virtual SPoint2 reparamOnFace(const GFace *face, double epar, int dir) const
bool readParametrization(FILE *fp, bool binary)
Curve * CreateReversedCurve(Curve *c)
virtual double curvature(double par) const
std::vector< MLine * > lines
static void Debug(const char *fmt,...)
static double c(int i, int j, fullMatrix< double > &CA, const std::vector< SPoint3 > &P, const std::vector< SPoint3 > &Q)
static void Warning(const char *fmt,...)
static void Error(const char *fmt,...)
std::vector< double > _pars
void setEndVertex(GVertex *gv)
bool writeParametrization(FILE *fp, bool binary)
virtual GPoint closestPoint(const SPoint3 &queryPoint, const double initialGuess[2]) const
bool SortEdgeConsecutive(const std::vector< MEdge > &e, std::vector< std::vector< MVertex * > > &vs)
std::vector< SPoint3 > _discretization
discreteEdge(GModel *model, int num, GVertex *_v0, GVertex *_v1)
void * Tree_Add(Tree_T *tree, void *data)
virtual GVertex * getBeginVertex() const
virtual Range< double > parBounds(int) const
virtual std::vector< GVertex * > vertices() const
double distance(const SPoint3 &p) const
virtual SVector3 firstDer(double par) const
virtual SPoint3 xyz() const
virtual void mesh(bool verbose)
void setBeginVertex(GVertex *gv)
Curve * CreateCurve(int Num, int Typ, int Order, List_T *Liste, List_T *Knots, int p1, int p2, double u1, double u2, bool &ok)
virtual GVertex * getEndVertex() const
GEO_Internals * getGEOInternals()
bool _getLocalParameter(const double &t, int &iEdge, double &tLoc) const