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"
13 #if defined(HAVE_OPENGL)
46 #if defined(HAVE_OPENGL)
50 for(
int i = 0; i <
getNbU(); ++i) {
51 for(
int j = 0; j <
getNbV(); ++j) {
60 double *opt,
double step,
double min,
151 return "Plugin(Particles) computes the trajectory "
152 "of particules in the force field given by the "
153 "`TimeStep'-th time step of a vector view "
155 "The plugin takes as input a grid defined by the "
156 "3 points (`X0',`Y0',`Z0') (origin), (`X1',`Y1',`Z1') "
157 "(axis of U) and (`X2',`Y2',`Z2') (axis of V).\n\n"
158 "The number of particles along U and V that are to "
159 "be transported is set with the options `NumPointsU' "
160 "and `NumPointsV'. The equation\n\n"
161 "A2 * d^2X(t)/dt^2 + A1 * dX(t)/dt + A0 * X(t) = F\n\n"
162 "is then solved with the initial conditions X(t=0) "
163 "chosen as the grid, dX/dt(t=0)=0, and with F "
164 "interpolated from the vector view.\n\n"
165 "Time stepping is done using a Newmark scheme with "
166 "step size `DT' and `MaxIter' maximum number of "
168 "If `View' < 0, the plugin is run on the current view.\n\n"
169 "Plugin(Particles) creates one new list-based view containing "
170 "multi-step vector points.";
195 double u =
getNbU() > 1 ? (double)iU / (
double)(
getNbU() - 1.) : 0.;
196 double v =
getNbV() > 1 ? (double)iV / (
double)(
getNbV() - 1.) : 0.;
242 const double gamma = 0.5, beta = 0.25;
243 double c1 = (A2 + gamma *
DT * A1 + beta *
DT *
DT * A0);
244 double c2 = (2 * A2 - (1 - 2 * gamma) *
DT * A1 -
245 (0.5 + gamma - 2 * beta) *
DT *
DT * A0);
247 (-A2 - (gamma - 1) *
DT * A1 - (0.5 - gamma + beta) *
DT *
DT * A0);
249 DT *
DT * (beta + (0.5 + gamma - 2 * beta) + (0.5 - gamma + beta));
251 for(
int i = 0; i <
getNbU(); ++i) {
252 for(
int j = 0; j <
getNbV(); ++j) {
253 double XINIT[3], X0[3], X1[3];
258 data2->
VP.push_back(XINIT[0]);
259 data2->
VP.push_back(XINIT[1]);
260 data2->
VP.push_back(XINIT[2]);
261 for(
int iter = 0; iter < maxIter; iter++) {
264 for(
int k = 0; k < 3; k++)
265 X[k] = (c2 * X1[k] + c3 * X0[k] + c4 *
F[k]) /
c1;
266 data2->
VP.push_back(X[0] - XINIT[0]);
267 data2->
VP.push_back(X[1] - XINIT[1]);
268 data2->
VP.push_back(X[2] - XINIT[2]);
269 for(
int k = 0; k < 3; k++) {
StringXNumber * getOption(int iopt)
GMSH_Plugin * GMSH_RegisterParticlesPlugin()
StringXNumber ParticlesOptions_Number[]
static double callbackZ0(int, int, double)
virtual int getNumTimeSteps()=0
static double callbackU(int, int, double)
static double callbackX2(int, int, double)
static void(* draw)(void *)
static void Error(const char *fmt,...)
virtual void setFileName(const std::string &val)
static double callbackY1(int, int, double)
static double callbackZ1(int, int, double)
static double callbackX0(int, int, double)
static double callbackZ2(int, int, double)
static double callbackY0(int, int, double)
static double callback(int num, int action, double value, double *opt, double step, double min, double max)
static double callbackV(int, int, double)
bool finalize(bool computeMinMax=true, const std::string &interpolationScheme="")
virtual void setName(const std::string &val)
static void getPoint(int iU, int iV, double *X)
static double callbackX1(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)
static void setDrawFunction(void(*fct)(void *))
virtual PView * getView(int index, PView *view)
virtual PViewData * getPossiblyAdaptiveData(PView *view)
PViewOptions * getOptions()
virtual std::string getName()
std::string getHelp() const
void drawSphere(double R, double x, double y, double z, int n1, int n2, int light)
static double callbackY2(int, int, double)
virtual PViewDataList * getDataList(PView *view, bool showError=true)