gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
6 #include "GmshConfig.h"
11 #if defined(HAVE_OPENGL)
36 #if defined(HAVE_OPENGL)
42 ctx->
drawString(
"(X0, Y0, Z0)", p[0], p[1], p[2]);
45 ctx->
drawString(
"(X1, Y1, Z1)", p[0], p[1], p[2]);
49 ctx->
drawString(
"(X2, Y2, Z2)", p[0], p[1], p[2]);
54 for(
int i = 0; i <
getNbU(); ++i) {
56 glVertex3d(p[0], p[1], p[2]);
58 glVertex3d(p[0], p[1], p[2]);
60 for(
int i = 0; i <
getNbV(); ++i) {
62 glVertex3d(p[0], p[1], p[2]);
64 glVertex3d(p[0], p[1], p[2]);
69 for(
int i = 0; i <
getNbU(); ++i) {
70 for(
int j = 0; j <
getNbV(); ++j) {
80 double *opt,
double step,
double min,
175 return "Plugin(CutGrid) cuts the view `View' with a "
176 "rectangular grid defined by the 3 points "
177 "(`X0',`Y0',`Z0') (origin), (`X1',`Y1',`Z1') (axis of U) "
178 "and (`X2',`Y2',`Z2') (axis of V).\n\n"
179 "The number of points along U and V is set with the "
180 "options `NumPointsU' and `NumPointsV'.\n\n"
181 "If `ConnectPoints' is zero, the plugin creates points; "
182 "otherwise, the plugin generates quadrangles, lines or "
183 "points depending on the values of `NumPointsU' and "
185 "If `View' < 0, the plugin is run on the current view.\n\n"
186 "Plugin(CutGrid) creates one new list-based view.";
205 double u =
getNbU() > 1 ? (double)iU / (
double)(
getNbU() - 1.) : 0.;
206 double v =
getNbV() > 1 ? (double)iV / (
double)(
getNbV() - 1.) : 0.;
219 double ***pnts,
double ***vals,
220 std::vector<double> &P,
int *nP,
221 std::vector<double> &L,
int *nL,
222 std::vector<double> &Q,
int *nQ)
226 for(
int i = 0; i <
getNbU(); ++i) {
227 for(
int j = 0; j <
getNbV(); ++j) {
228 P.push_back(pnts[i][j][0]);
229 P.push_back(pnts[i][j][1]);
230 P.push_back(pnts[i][j][2]);
232 for(
int k = 0; k < numsteps; ++k) {
233 for(
int l = 0; l < nbcomp; ++l)
234 P.push_back(vals[i][j][nbcomp * k + l]);
242 for(
int i = 0; i <
getNbV() - 1; ++i) {
243 L.push_back(pnts[0][i][0]);
244 L.push_back(pnts[0][i + 1][0]);
245 L.push_back(pnts[0][i][1]);
246 L.push_back(pnts[0][i + 1][1]);
247 L.push_back(pnts[0][i][2]);
248 L.push_back(pnts[0][i + 1][2]);
250 for(
int k = 0; k < numsteps; ++k) {
251 for(
int l = 0; l < nbcomp; ++l)
252 L.push_back(vals[0][i][nbcomp * k + l]);
253 for(
int l = 0; l < nbcomp; ++l)
254 L.push_back(vals[0][i + 1][nbcomp * k + l]);
259 for(
int i = 0; i <
getNbU() - 1; ++i) {
260 L.push_back(pnts[i][0][0]);
261 L.push_back(pnts[i + 1][0][0]);
262 L.push_back(pnts[i][0][1]);
263 L.push_back(pnts[i + 1][0][1]);
264 L.push_back(pnts[i][0][2]);
265 L.push_back(pnts[i + 1][0][2]);
267 for(
int k = 0; k < numsteps; ++k) {
268 for(
int l = 0; l < nbcomp; ++l)
269 L.push_back(vals[i][0][nbcomp * k + l]);
270 for(
int l = 0; l < nbcomp; ++l)
271 L.push_back(vals[i + 1][0][nbcomp * k + l]);
276 for(
int i = 0; i <
getNbU() - 1; ++i) {
277 for(
int j = 0; j <
getNbV() - 1; ++j) {
278 Q.push_back(pnts[i][j][0]);
279 Q.push_back(pnts[i + 1][j][0]);
280 Q.push_back(pnts[i + 1][j + 1][0]);
281 Q.push_back(pnts[i][j + 1][0]);
282 Q.push_back(pnts[i][j][1]);
283 Q.push_back(pnts[i + 1][j][1]);
284 Q.push_back(pnts[i + 1][j + 1][1]);
285 Q.push_back(pnts[i][j + 1][1]);
286 Q.push_back(pnts[i][j][2]);
287 Q.push_back(pnts[i + 1][j][2]);
288 Q.push_back(pnts[i + 1][j + 1][2]);
289 Q.push_back(pnts[i][j + 1][2]);
291 for(
int k = 0; k < numsteps; ++k) {
292 for(
int l = 0; l < nbcomp; ++l)
293 Q.push_back(vals[i][j][nbcomp * k + l]);
294 for(
int l = 0; l < nbcomp; ++l)
295 Q.push_back(vals[i + 1][j][nbcomp * k + l]);
296 for(
int l = 0; l < nbcomp; ++l)
297 Q.push_back(vals[i + 1][j + 1][nbcomp * k + l]);
298 for(
int l = 0; l < nbcomp; ++l)
299 Q.push_back(vals[i][j + 1][nbcomp * k + l]);
321 int maxcomp = nbt ? 9 : (nbv ? 3 : 1);
324 double ***pnts =
new double **[
getNbU()];
325 double ***vals =
new double **[
getNbU()];
326 for(
int i = 0; i <
getNbU(); i++) {
327 pnts[i] =
new double *[
getNbV()];
328 vals[i] =
new double *[
getNbV()];
329 for(
int j = 0; j <
getNbV(); j++) {
330 pnts[i][j] =
new double[3];
331 vals[i][j] =
new double[maxcomp * numsteps];
337 for(
int i = 0; i <
getNbU(); i++)
338 for(
int j = 0; j <
getNbV(); j++)
339 o.
searchScalar(pnts[i][j][0], pnts[i][j][1], pnts[i][j][2], vals[i][j]);
345 for(
int i = 0; i <
getNbU(); i++)
346 for(
int j = 0; j <
getNbV(); j++)
347 o.
searchVector(pnts[i][j][0], pnts[i][j][1], pnts[i][j][2], vals[i][j]);
353 for(
int i = 0; i <
getNbU(); i++)
354 for(
int j = 0; j <
getNbV(); j++)
355 o.
searchTensor(pnts[i][j][0], pnts[i][j][1], pnts[i][j][2], vals[i][j]);
360 for(
int i = 0; i <
getNbU(); i++) {
361 for(
int j = 0; j <
getNbV(); j++) {
static double callbackY2(int, int, double)
bool searchScalar(double x, double y, double z, double *values, int step=-1, double *size=nullptr, int qn=0, double *qx=nullptr, double *qy=nullptr, double *qz=nullptr, bool grad=false, int dim=-1)
static double callbackZ2(int, int, double)
StringXNumber * getOption(int iopt)
virtual int getNumTimeSteps()=0
static void(* draw)(void *)
void drawString(const std::string &s, double x, double y, double z, const std::string &font_name, int font_enum, int font_size, int align, int line_num=0)
static double callbackV(int, int, double)
virtual void setFileName(const std::string &val)
static double callbackConnect(int, int, double)
void addInView(int numsteps, int connect, int nbcomp, double ***pnts, double ***vals, std::vector< double > &P, int *nP, std::vector< double > &L, int *nL, std::vector< double > &Q, int *nQ)
static double callbackU(int, int, double)
static double callbackZ0(int, int, double)
virtual int getNumScalars(int step=-1)
static double callbackZ1(int, int, double)
static double callbackY0(int, int, double)
static double callbackX1(int, int, double)
bool finalize(bool computeMinMax=true, const std::string &interpolationScheme="")
virtual void setName(const std::string &val)
GMSH_Plugin * GMSH_RegisterCutGridPlugin()
virtual int getNumVectors(int step=-1)
static double callbackX2(int, int, double)
bool searchVector(double x, double y, double z, double *values, int step=-1, double *size=nullptr, int qn=0, double *qx=nullptr, double *qy=nullptr, double *qz=nullptr, bool grad=false, int dim=-1)
virtual int getNumTensors(int step=-1)
static void setDrawFunction(void(*fct)(void *))
virtual PView * getView(int index, PView *view)
virtual PViewData * getPossiblyAdaptiveData(PView *view)
static void getPoint(int iU, int iV, double *X)
virtual std::string getName()
static double callbackY1(int, int, double)
PView * GenerateView(PView *v, int connectPoints)
static double callback(int num, int action, double value, double *opt, double step, double min, double max)
std::string getHelp() const
StringXNumber CutGridOptions_Number[]
void drawSphere(double R, double x, double y, double z, int n1, int n2, int light)
static double callbackX0(int, int, double)
virtual PViewDataList * getDataList(PView *view, bool showError=true)
bool searchTensor(double x, double y, double z, double *values, int step=-1, double *size=nullptr, int qn=0, double *qx=nullptr, double *qy=nullptr, double *qz=nullptr, bool grad=false, int dim=-1)