using namespace gismo;
int main(
int argc,
char* argv[])
{
std::string func_name_x("x");
std::string func_name_y("y");
std::string func_name_z("z");
gsCmdLine cmd(
"Input is coordinate functions X(x,y,z), Y(x,y,z). Z(x,y,z), or"
"X(x,y), Y(x,y). Z(x,y), or X(x), Y(x). Z(x). This is controlled by"
"the dimension parameter d. The parameters take values in the interval [0,1]");
cmd.addInt("p", "degree", "this is the degree", p);
cmd.addInt("k", "knots", "This is the number of interior knots", k);
cmd.addInt("d", "dim", "this is the parametric dimension", d);
cmd.addInt("s", "samples", "this is samples for paraview", s);
cmd.addString("X", "f1", "The X-coordinate of the function", func_name_x);
cmd.addString("Y", "f2", "The Y-coordinate of the function", func_name_y);
cmd.addString("Z", "f3", "The Z-coordinate of the function", func_name_z);
try { cmd.getValues(argc,argv); } catch (int rv) { return rv; }
switch (d)
{
case 1:
break;
case 2:
break;
case 3:
break;
default:
{
gsWarn<<
"Dimension must be 1, 2 or 3.";
return 0;
}
};
gsInfo <<"We are going to interpolate "<< func <<"\n";
gsInfo <<"Int. grid dim: "<< intGrid.dim() <<"\n";
gsInfo <<"Function values dim: "<< fValues.dim() <<"\n";
gsInfo << "Result :"<< *interpolant <<"\n";
fd << mp;
std::string remark("Made by interpolation from function: ( ");
{
remark += func.expression(i);
remark += ( i==2 ? " )" : " , ");
}
fd.addComment( remark );
fd.
save(
"interpolant_spline");
gsInfo <<"Result saved as interpolant_spline.xml \n";
return 0;
}