#include <iostream>
#include <string>
int main(int argc, char* argv[])
{
real_t a = 0;
real_t b = 1;
bool paraview = false;
gsCmdLine cmd(
"This is a tutorial on the gsBSplineBasis class.");
cmd.addReal("","starting","Starting knot",a);
cmd.addReal("","ending","Ending knot",b);
cmd.addInt("n","interior","Number of interior knots",interior);
cmd.addInt("m","mult","Multiplicity at the two end knots",multEnd);
cmd.addSwitch("plot","Plot with paraview",paraview);
try { cmd.getValues(argc,argv); } catch (int rv) { return rv; }
gsInfo <<
"------------- Constructions -------------\n";
int degree = multEnd - 1;
print(bsb0, "bsb0");
print(bsb1, "bsb1");
gsInfo <<
"------------- Some properties -------------\n\n";
gsInfo <<
"bsb0.size(): " << bsb0.size() <<
"\n\n"
<< "bsb0.numElements(): " << bsb0.numElements() << "\n\n"
<< "bsb0.degree(): " << bsb0.degree() << "\n\n";
gsInfo <<
"------------- Some operations -------------\n\n";
if (paraview)
printToParaview(bsb0, "basis");
gsInfo <<
"bsb0.uniformRefine()\n";
bsb0.uniformRefine();
if (paraview)
printToParaview(bsb0, "basisRefined");
gsInfo <<
"bsb0.degreeElevate()\n";
bsb0.degreeElevate();
if (paraview)
printToParaview(bsb0, "basisElevated");
else
gsInfo <<
"Done. No output created, re-run with --plot to get a ParaView "
"files containing the solution.\n";
return 0;
}
const std::string& name)
{
gsInfo <<
"Writing bsb0 to paraview in a file: " << name <<
"\n\n";
gsWriteParaview(bsb, name);
}
const std::string& name)
{
}
A univariate B-spline basis.
Definition gsBSplineBasis.h:700
Class for command-line argument parsing.
Definition gsCmdLine.h:57
Class for representing a knot vector.
Definition gsKnotVector.h:80
std::ostream & print(std::ostream &os=gsInfo) const
Definition gsKnotVector.hpp:493
std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition gsBSplineBasis.hpp:1100
Main header to be included by clients using the G+Smo library.
#define index_t
Definition gsConfig.h:32
#define gsInfo
Definition gsDebug.h:43
The G+Smo namespace, containing all definitions for the library.