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"
22 #if defined(HAVE_POST)
42 #if defined(HAVE_PETSC)
44 #elif defined(HAVE_GMM)
53 printf(
"-- done solving!\n");
139 for(std::size_t i = 0; i <
allNeumann.size(); i++) {
140 std::cout <<
"Neumann BC" << std::endl;
149 printf(
"Lagrange Mult Lag\n");
156 printf(
"Lagrange Mult Lap\n");
162 printf(
"Lagrange Mult Load\n");
172 printf(
"Thermic Term\n");
207 for(
int j = 0; j < npts; j++) {
208 double u = GP[j].
pt[0];
209 double v = GP[j].
pt[1];
210 double w = GP[j].
pt[2];
211 double weight = GP[j].
weight;
216 solField.
f(e, u, v, w, FEMVALUE);
217 double diff = (*sol)(p.
x(), p.
y(), p.
z()) - FEMVALUE;
218 val += diff * diff * detJ * weight;
225 printf(
"L2Norm = %g\n", sqrt(val));
231 double val = 0.0, val2 = 0.0;
246 for(
int j = 0; j < npts; j++) {
247 double u = GP[j].
pt[0];
248 double v = GP[j].
pt[1];
249 double w = GP[j].
pt[2];
250 double weight = GP[j].
weight;
255 solField.
f(e, u, v, w, FEMVALUE);
256 double diff = (*sol)(p.
x(), p.
y(), p.
z()) - FEMVALUE;
257 val += diff * diff * detJ * weight;
258 val2 += (*sol)(p.
x(), p.
y(), p.
z()) * (*sol)(p.
x(), p.
y(), p.
z()) *
266 printf(
"LagNorm = %g\n", sqrt(val / val2));
267 return sqrt(val / val2);
270 #if defined(HAVE_POST)
272 PView *thermicSolver::buildTemperatureView(
const std::string postFileName)
274 std::cout <<
"build Temperature View" << std::endl;
275 std::set<MVertex *> v;
276 std::map<MVertex *, MElement *> vCut;
284 if(vCut.find(e->
getVertex(j)) == vCut.end())
294 std::map<int, std::vector<double> > data;
296 for(
auto it = v.begin(); it != v.end(); ++it) {
299 Field.f(&p, 0, 0, 0, val);
300 std::vector<double> vec;
302 data[(*it)->getNum()] = vec;
304 for(
auto it = vCut.begin();
305 it != vCut.end(); ++it) {
308 double xyz[3] = {it->first->x(), it->first->y(), it->first->z()};
309 it->second->xyz2uvw(xyz, uvw);
310 Field.f(it->second, uvw[0], uvw[1], uvw[2],
312 std::vector<double> vec;
314 data[it->first->getNum()] = vec;
321 thermicSolver::buildLagrangeMultiplierView(
const std::string &postFileName)
323 std::cout <<
"build Lagrange Multiplier View" << std::endl;
325 std::set<MVertex *> v;
335 std::map<int, std::vector<double> > data;
337 for(
auto it = v.begin(); it != v.end(); ++it) {
340 Field.f(&p, 0, 0, 0, val);
341 std::vector<double> vec;
343 data[(*it)->getNum()] = vec;
349 PView *thermicSolver::buildErrorEstimateView(
const std::string &errorFileName,
352 std::cout <<
"build Error View" << std::endl;
353 std::map<int, std::vector<double> > data;
367 for(
int j = 0; j < npts; j++) {
368 double u = GP[j].
pt[0];
369 double v = GP[j].
pt[1];
370 double w = GP[j].
pt[2];
371 double weight = GP[j].
weight;
376 solField.f(e, u, v, w, FEMVALUE);
377 double diff = (*sol)(p.
x(), p.
y(), p.
z()) - FEMVALUE;
378 val += diff * diff * detJ * weight;
380 std::vector<double> vec;
381 vec.push_back(sqrt(val));
virtual std::size_t getNum() const
double computeL2Norm(simpleFunction< double > *f)
virtual void getIntegrationPoints(int pOrder, int *npts, IntPt **pts)
void f(int n, double u, double *val)
void NumberDofs(FunctionSpaceBase &space, Iterator itbegin, Iterator itend, Assembler &assembler)
virtual MElement * getParent() const
void assemble(linearSystem< double > *lsys)
void setEdgeTemp(int edge, simpleFunction< double > *f)
GModel * buildCutGModel(gLevelset *ls, bool cutElem=true, bool saveTri=false)
virtual int sizeOfR() const
void cutMesh(gLevelset *ls)
virtual std::size_t getNumVertices() const =0
simpleFunction< double > * _f
int readMSH(const std::string &name)
virtual const MVertex * getVertex(int num) const =0
virtual void setMesh(const std::string &meshFileName)
void Assemble(BilinearTermBase &term, FunctionSpaceBase &space, Iterator itbegin, Iterator itend, QuadratureBase &integrator, Assembler &assembler)
FunctionSpace< double > * LagrangeMultiplierSpace
virtual int systemSolve()
virtual int sizeOfF() const
simpleFunction< double > * _f
std::vector< dirichletBCT > allDirichlet
std::size_t getNumRegions() const
int writeMSH(const std::string &name, double version=2.2, bool binary=false, bool saveAll=false, bool saveParametric=false, double scalingFactor=1.0, int elementStartNum=0, int saveSinglePartition=0, bool append=false)
virtual void pnt(double u, double v, double w, SPoint3 &p) const
std::vector< LagrangeMultiplierFieldT > LagrangeMultiplierFields
void changeLMTau(int tag, double tau)
void setThermicDomain(int phys, double k)
double computeLagNorm(int tag, simpleFunction< double > *f)
dofManager< double > * pAssembler
std::vector< thermicField > thermicFields
virtual double getJacobian(const fullMatrix< double > &gsf, double jac[3][3]) const
void FixNodalDofs(FunctionSpaceBase &space, MElement *e, Assembler &assembler, simpleFunction< typename Assembler::dataVec > &fct, FilterDof &filter)
virtual int getPolynomialOrder() const
std::vector< neumannBCT > allNeumann
void setFaceTemp(int face, simpleFunction< double > *f)
FunctionSpace< double > * LagSpace
void setLagrangeMultipliers(int phys, double tau, int tag, simpleFunction< double > *f)
virtual void f(MElement *ele, double u, double v, double w, ValType &val) const