#include <iostream>
template <typename T>
{
return result;
}
int main(int argc, char* argv[])
{
std::string input("bspbasis/tpBSpline2_02.xml");
std::string output("");
cmd.addPlainString("input", "G+Smo input basis file.", input);
cmd.addString("o", "output", "Name of the output file.", output);
try { cmd.getValues(argc,argv); } catch (int rv) { return rv; }
{
}
else
{
gsInfo <<
"Input file doesn't have a basis inside.\n";
return -1;
}
if (!pBasis)
{
gsInfo <<
"Didn't find any basis.\n";
return -1;
}
gsInfo <<
"The file contains: \n" << *pBasis <<
"\n";
gsInfo <<
"Dimension of the parameter space: " << pBasis->dim() <<
"\n"
<< "Number of basis functions: " << pBasis->size() << "\n"
<< "Number of elements: " << pBasis->numElements() << "\n"
<< "Max degree of the basis: " << pBasis->maxDegree() << "\n"
<< "Min degree of the basis: " << pBasis->minDegree() << "\n"
<< "\n";
<< support << "\n\n";
gsMatrix<> u = 0.3 * support.col(0) + 0.7 * support.col(1);
gsInfo <<
"u " << size(u) <<
": \n" << u <<
"\n\n";
gsInfo <<
"#Active basis functions at u: " << size(active) <<
": \n"
<< active << "\n\n";
gsInfo <<
"Is number 2 active at the point ? " <<pBasis->isActive(0,u.col(0)) <<
": \n"
<< active << "\n\n";
gsInfo <<
"Values at u " << size(values) <<
": \n"
<< values << "\n\n";
for (
index_t i = 0; i != active.rows(); i++)
{
gsMatrix<> val = pBasis->evalSingle(active(i), u);
gsInfo <<
"basis fun. index: " << active(i)
<< " value: " << val(0, 0) << "\n";
}
gsInfo <<
"Derivatives at u " << size(derivs) <<
": \n"
<< derivs << "\n\n";
for (
index_t i = 0; i != active.rows(); i++)
{
gsMatrix<> der = pBasis->derivSingle(active(i), u);
gsInfo <<
"basis fun. index: " << active(i)
<< " value: " << std::setw(15) << der(0, 0) << "\n";
for (
index_t row = 1; row != der.rows(); row++)
{
gsInfo << std::setw(46) << der(row, 0) <<
"\n";
}
}
gsInfo <<
"Second derivatives at u " << size(derivs2) <<
": \n"
<< derivs2 << "\n\n";
for (
index_t i = 0; i != active.rows(); i++)
{
gsMatrix<> der2 = pBasis->deriv2Single(active(i), u);
gsInfo <<
"basis fun. index: " << active(i)
<< " value: " << std::setw(15) << der2(0, 0) << "\n";
for (
index_t row = 1; row != der2.rows(); row++)
{
gsInfo << std::setw(46) << der2(row, 0) <<
"\n";
}
}
gsInfo <<
"\nFor more information about evaluation "
<< "(and order of derivatives) look at doxygen documentation."
<< "\n\n";
if (output != "")
{
gsInfo <<
"Writing the basis to a paraview file: " << output
<< "\n\n";
gsWriteParaview(*pBasis, output, 1000);
}
else
{
gsInfo <<
"Done. No output created, re-run with --output <filename> to get a ParaView "
"file containing the solution.\n";
}
return 0;
}
A basis represents a family of scalar basis functions defined over a common parameter domain.
Definition gsBasis.h:79
memory::unique_ptr< gsBasis > uPtr
Unique pointer for gsBasis.
Definition gsBasis.h:89
Class for command-line argument parsing.
Definition gsCmdLine.h:57
This class represents an XML data tree which can be read from or written to a (file) stream.
Definition gsFileData.h:34
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Main header to be included by clients using the G+Smo library.
std::string to_string(const C &value)
Converts value to string, assuming "operator<<" defined on C.
Definition gsUtils.h:56
#define index_t
Definition gsConfig.h:32
#define gsInfo
Definition gsDebug.h:43
The G+Smo namespace, containing all definitions for the library.