// PACKAGE : FFPUB: routines for reporting in html
// PKG.TYPE: Publishing tools
// VERSION : 0.1.072619
// AUTHOR : Fotios Kasolis, fotios.kasolis@gmail.com,
// LICENSE : Creative Commons Attribution 4.0 International License
// http://creativecommons.org/licenses/by/4.0/
bool PUBfigs = false;
string PUBtimerinfo = "Solution";
macro PUBconvert(PUBfilename)
{
exec("inkscape -z -f \"" + PUBfilename + ".eps\" --export-dpi=128 -e \"" + PUBfilename + ".png\"");
}//
macro PUBopen(PUBfilename, title, author)
{
ofstream pubfile(PUBfilename+".html", append);
pubfile << ""<< endl;
pubfile << "" << endl;
pubfile << "" << endl;
pubfile << "
" + title + "" << endl;
pubfile << "" << endl;
pubfile << "" + title + "
" << endl;
pubfile << "" + author + "
" << endl;
}//
macro PUBclose(PUBfilename)
{
ofstream pubfile(PUBfilename+".html", append);
pubfile << "" << endl;
}//
macro PUBmesh(PUBfilename, msh)
{
fespace pubmeshdata(msh, P0);
pubmeshdata h = hTriangle;
ofstream pubfile(PUBfilename+".html", append);
pubfile.scientific;
pubfile << "" << Stringification(msh) << ": Mesh
" << endl;
pubfile << "Attribute | Value |
---|
" << endl;
pubfile << "
Number of elements | " << msh.nt << " |
" << endl;
pubfile << "Number of vertices | " << msh.nv << " |
" << endl;
pubfile << "Maximum edge length | " << h[].max << " |
" << endl;
pubfile << "Minimum edge size | " << h[].min << " |
" << endl;
}//
macro PUBfespace(PUBfilename, fem)
{
ofstream pubfile(PUBfilename+".html", append);
pubfile.scientific;
pubfile << "" << Stringification(fem) << ": Finite Element Space
" << endl;
pubfile << "Attribute | Value |
---|
" << endl;
pubfile << "
Degrees of freedom | " << fem.ndof << " |
" << endl;
pubfile << "Degrees of freedom per element | " << fem.ndofK << " |
" << endl;
}//
macro PUBtic(PUBtimerid)
{
PUBtimerid = clock();
}//
macro PUBtoc(PUBfilename, PUBtimerid)
{
ofstream pubfile(PUBfilename+".html", append);
pubfile.precision(4);
pubfile << "" << Stringification(PUBtimerid) << ": Timing Information
" << endl;
pubfile << " The process you timed took " << clock() - PUBtimerid << " seconds
" << endl; ;
}//
macro PUBsolution(PUBfilename, PUBsolution)
{
ofstream pubfile(PUBfilename+".html", append);
pubfile.scientific;
pubfile << "" << Stringification(PUBsolution) << ": Solution Information
" << endl;
pubfile << "Attribute | Value |
---|
" << endl;
pubfile << "
Maximum value of finite element function " << Stringification(PUBsolution) << " | " << PUBsolution[].max << " |
" << endl;
pubfile << "Minimum value of finite element function " << Stringification(PUBsolution) << " | " << PUBsolution[].min << " |
" << endl;
}//
macro PUBuserinfo(PUBfilename, PUBdim, PUBmeshgen, PUBelements, PUBlinsolver, PUBnonlinsolver, PUBtransient)
{
ofstream pubfile(PUBfilename+".html", append);
pubfile.scientific;
pubfile << "General Information
" << endl;
pubfile << "Attribute | Value |
---|
" << endl;
pubfile << "
Space Dimension " << " | " << PUBdim << " |
" << endl;
pubfile << "Mesh Generator " << " | " << PUBmeshgen << " |
" << endl;
pubfile << "Finite Elements " << " | " << PUBelements << " |
" << endl;
pubfile << "Linear Solver " << " | " << PUBlinsolver << " |
" << endl;
pubfile << "Nonlinear Solver " << " | " << PUBnonlinsolver << " |
" << endl;
pubfile << "Time Integration " << " | " << PUBtransient << " |
" << endl;
}//
macro PUBaddfig(PUBfilename, PUBfigname)
{
ofstream pubfile(PUBfilename+".html", append);
pubfile << "" << endl; ;
}//
macro PUBremark(PUBfilename, PUBcomment) {
ofstream pubfile(PUBfilename+".html", append);
pubfile << "
" << endl;
pubfile << "Remark." << PUBcomment << "" << endl;
pubfile << "
" << endl;
}//