-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add gsOptionList add gsQuadRule fix gsNurbsCreator fix gsSparseMatrix
- Loading branch information
Showing
16 changed files
with
484 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
|
||
#include <gismo.h> | ||
#include <gsCInterface/gsCTypes.h> | ||
#include <gsCInterface/gsMacros.h> | ||
#include <gsCInterface/gsCFitting.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
GISMO_EXPORT gsCFitting * gsFitting_create(gsCMatrix * param_values, gsCMatrix * points, gsCBasis * basis) | ||
{ | ||
auto * param_values_ptr = RICAST_M(param_values); | ||
auto * points_ptr = RICAST_M(points); | ||
auto * basis_ptr = RICAST_B(basis); | ||
return reinterpret_cast<gsCFitting*>(new gismo::gsFitting<double>(*param_values_ptr, *points_ptr, *basis_ptr)); | ||
} | ||
|
||
GISMO_EXPORT void gsFitting_delete(gsCFitting * fitter) | ||
{ | ||
delete reinterpret_cast<gismo::gsFitting<double>*>(fitter); | ||
} | ||
|
||
GISMO_EXPORT void gsFitting_compute(gsCFitting * fitter, double lambda) | ||
{ | ||
reinterpret_cast<gismo::gsFitting<double>*>(fitter)->compute(lambda); | ||
} | ||
|
||
GISMO_EXPORT void gsFitting_parameterCorrection(gsCFitting * fitter, double accuracy, int maxIter, double tolOrth) | ||
{ | ||
reinterpret_cast<gismo::gsFitting<double>*>(fitter)->parameterCorrection(accuracy, maxIter, tolOrth); | ||
} | ||
|
||
GISMO_EXPORT void gsFitting_computeErrors(gsCFitting * fitter) | ||
{ | ||
reinterpret_cast<gismo::gsFitting<double>*>(fitter)->computeErrors(); | ||
} | ||
|
||
GISMO_EXPORT double gsFitting_minPointError(gsCFitting * fitter) | ||
{ | ||
return reinterpret_cast<gismo::gsFitting<double>*>(fitter)->minPointError(); | ||
} | ||
|
||
GISMO_EXPORT double gsFitting_maxPointError(gsCFitting * fitter) | ||
{ | ||
return reinterpret_cast<gismo::gsFitting<double>*>(fitter)->maxPointError(); | ||
} | ||
|
||
GISMO_EXPORT double* gsFitting_pointWiseErrors(gsCFitting * fitter) | ||
{ | ||
const double * errors = reinterpret_cast< const double* >(reinterpret_cast<gismo::gsFitting<double>*>(fitter)->pointWiseErrors().data()); | ||
return const_cast<double *>(errors); | ||
} | ||
|
||
GISMO_EXPORT int gsFitting_numPointsBelow(gsCFitting * fitter, double threshold) | ||
{ | ||
return reinterpret_cast<gismo::gsFitting<double>*>(fitter)->numPointsBelow(threshold); | ||
} | ||
|
||
GISMO_EXPORT gsCGeometry* gsFitting_result(gsCFitting * fitter) | ||
{ | ||
auto * result = reinterpret_cast<gismo::gsFitting<double>*>(fitter)->result(); | ||
return RICAST_CG(result->clone().release()); | ||
} | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
GISMO_EXPORT gsCFitting* gsFitting_create(gsCMatrix * param_values, gsCMatrix * points, gsCBasis * basis); | ||
GISMO_EXPORT void gsFitting_delete(gsCFitting * fitter); | ||
|
||
GISMO_EXPORT void gsFitting_compute(gsCFitting* fitter, double lambda); | ||
GISMO_EXPORT void gsFitting_parameterCorrection(gsCFitting* fitter, double accuracy, int maxIter, double tolOrth); | ||
|
||
GISMO_EXPORT void gsFitting_computeErrors(gsCFitting* fitter); | ||
|
||
GISMO_EXPORT double gsFitting_minPointError(gsCFitting* fitter); | ||
GISMO_EXPORT double gsFitting_maxPointError(gsCFitting* fitter); | ||
GISMO_EXPORT double* gsFitting_pointWiseErrors(gsCFitting* fitter); | ||
GISMO_EXPORT int gsFitting_numPointsBelow(gsCFitting* fitter, double threshold); | ||
|
||
GISMO_EXPORT gsCGeometry* gsFitting_result(gsCFitting* fitter); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
|
||
#include <gismo.h> | ||
#include <gsCInterface/gsCTypes.h> | ||
#include <gsCInterface/gsCMatrix.h> | ||
#include <gsCInterface/gsCGeometry.h> | ||
#include <gsCInterface/gsCKnotVector.h> | ||
#include <gsCInterface/gsCBasis.h> | ||
#include <gsCInterface/gsMacros.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_BSplineUnitInterval(int deg) | ||
{ | ||
return RICAST_CG(gismo::gsNurbsCreator<double>::BSplineUnitInterval(deg).release()); | ||
} | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_BSplineRectangle(double low_x, double low_y, double upp_x, double upp_y, double turndeg) | ||
{ | ||
return RICAST_CG(gismo::gsNurbsCreator<double>::BSplineRectangle(low_x, low_y, upp_x, upp_y, turndeg).release()); | ||
} | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_BSplineTrapezium(double Lbot, double Ltop, double H, double d, double turndeg) | ||
{ | ||
return RICAST_CG(gismo::gsNurbsCreator<double>::BSplineTrapezium(Lbot, Ltop, H, d, turndeg).release()); | ||
} | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_BSplineSquare(double r, double x, double y) | ||
{ | ||
return RICAST_CG(gismo::gsNurbsCreator<double>::BSplineSquare(r, x, y).release()); | ||
} | ||
|
||
GISMO_EXPORT gsCMultiPatch* gsNurbsCreator_BSplineSquareGrid(int n, int m, double r, double lx, double ly) | ||
{ | ||
return RICAST_CMP(new gismo::gsMultiPatch<double>(gismo::gsNurbsCreator<double>::BSplineSquareGrid(n, m, r, lx, ly))); | ||
} | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_BSplineCube(double r, double x, double y, double z) | ||
{ | ||
return RICAST_CG(gismo::gsNurbsCreator<double>::BSplineCube(r, x, y, z).release()); | ||
} | ||
|
||
GISMO_EXPORT gsCMultiPatch* gsNurbsCreator_BSplineCubeGrid(int n, int m, int p, double r, double lx, double ly, double lz) | ||
{ | ||
return RICAST_CMP(new gismo::gsMultiPatch<double>(gismo::gsNurbsCreator<double>::BSplineCubeGrid(n, m, p, r, lx, ly, lz))); | ||
} | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_NurbsQuarterAnnulus(double r0, double r1) | ||
{ | ||
return RICAST_CG(gismo::gsNurbsCreator<double>::NurbsQuarterAnnulus(r0, r1).release()); | ||
} | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_NurbsAnnulus(double r0, double r1) | ||
{ | ||
return RICAST_CG(gismo::gsNurbsCreator<double>::NurbsAnnulus(r0, r1).release()); | ||
} | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_BSplineSaddle() | ||
{ | ||
return RICAST_CG(gismo::gsNurbsCreator<double>::BSplineSaddle().release()); | ||
} | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_NurbsSphere(double r, double x, double y, double z) | ||
{ | ||
return RICAST_CG(gismo::gsNurbsCreator<double>::NurbsSphere(r, x, y, z).release()); | ||
} | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_NurbsCircle(double r, double x, double y) | ||
{ | ||
return RICAST_CG(gismo::gsNurbsCreator<double>::NurbsCircle(r, x, y).release()); | ||
} | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_BSplineTriangle(double H, double W) | ||
{ | ||
return RICAST_CG(gismo::gsNurbsCreator<double>::BSplineTriangle(H, W).release()); | ||
} | ||
|
||
GISMO_EXPORT gsCMultiPatch* gsNurbsCreator_BSplineStar(int N, double R0, double R1) | ||
{ | ||
return RICAST_CMP(new gismo::gsMultiPatch<double>(gismo::gsNurbsCreator<double>::BSplineStar(N, R0, R1))); | ||
} | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_BSplineUnitInterval(int); | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_BSplineRectangle(double, double, double, double, double); | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_BSplineTrapezium(double, double, double, double, double); | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_BSplineSquare(double, double, double); | ||
|
||
GISMO_EXPORT gsCMultiPatch* gsNurbsCreator_BSplineSquareGrid(int, int, double, double, double); | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_BSplineCube(double, double, double, double); | ||
|
||
GISMO_EXPORT gsCMultiPatch* gsNurbsCreator_BSplineCubeGrid(int, int, int, double, double, double); | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_NurbsQuarterAnnulus(double, double); | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_NurbsAnnulus(double, double); | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_BSplineSaddle(); | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_NurbsSphere(double, double, double, double); | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_NurbsCircle(double, double, double); | ||
|
||
GISMO_EXPORT gsCGeometry* gsNurbsCreator_BSplineTriangle(double, double); | ||
|
||
GISMO_EXPORT gsCMultiPatch* gsNurbsCreator_BSplineStar(int, double, double); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
|
||
#include <gismo.h> | ||
#include <gsCInterface/gsCTypes.h> | ||
#include <gsCInterface/gsMacros.h> | ||
#include <gsCInterface/gsCOptionList.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
GISMO_EXPORT gsCOptionList * gsOptionList_create() | ||
{ | ||
return reinterpret_cast<gsCOptionList*>(new gismo::gsOptionList()); | ||
} | ||
|
||
GISMO_EXPORT void gsOptionList_delete(gsCOptionList * ol) | ||
{ | ||
delete reinterpret_cast<gismo::gsOptionList*>(ol); | ||
} | ||
|
||
GISMO_EXPORT void gsOptionList_print(gsCOptionList * ol) | ||
{ | ||
reinterpret_cast<gismo::gsOptionList*>(ol)->print(gsInfo); | ||
} | ||
|
||
GISMO_EXPORT void gsOptionList_addString(gsCOptionList * ol, const char * label, const char * description, const char * value) | ||
{ | ||
reinterpret_cast<gismo::gsOptionList*>(ol)->addString(label, description, value); | ||
} | ||
|
||
GISMO_EXPORT void gsOptionList_addInt(gsCOptionList * ol, const char * label, const char * description, int value) | ||
{ | ||
reinterpret_cast<gismo::gsOptionList*>(ol)->addInt(label, description, value); | ||
} | ||
|
||
GISMO_EXPORT void gsOptionList_addReal(gsCOptionList * ol, const char * label, const char * description, double value) | ||
{ | ||
reinterpret_cast<gismo::gsOptionList*>(ol)->addReal(label, description, value); | ||
} | ||
|
||
GISMO_EXPORT void gsOptionList_addSwitch(gsCOptionList * ol, const char * label, const char * description, int value) | ||
{ | ||
reinterpret_cast<gismo::gsOptionList*>(ol)->addSwitch(label, description, value); | ||
} | ||
|
||
GISMO_EXPORT void gsOptionList_setString(gsCOptionList * ol, const char * label, const char * value) | ||
{ | ||
reinterpret_cast<gismo::gsOptionList*>(ol)->setString(label, value); | ||
} | ||
|
||
GISMO_EXPORT void gsOptionList_setInt(gsCOptionList * ol, const char * label, int value) | ||
{ | ||
reinterpret_cast<gismo::gsOptionList*>(ol)->setInt(label, value); | ||
} | ||
|
||
GISMO_EXPORT void gsOptionList_setReal(gsCOptionList * ol, const char * label, double value) | ||
{ | ||
reinterpret_cast<gismo::gsOptionList*>(ol)->setReal(label, value); | ||
} | ||
|
||
GISMO_EXPORT void gsOptionList_setSwitch(gsCOptionList * ol, const char * label, int value) | ||
{ | ||
reinterpret_cast<gismo::gsOptionList*>(ol)->setSwitch(label, value); | ||
} | ||
|
||
GISMO_EXPORT char* gsOptionList_getString(gsCOptionList * ol, const char * label) | ||
{ | ||
return const_cast<char*>(reinterpret_cast<gismo::gsOptionList*>(ol)->getString(label).c_str()); | ||
} | ||
|
||
GISMO_EXPORT int gsOptionList_getInt(gsCOptionList * ol, const char * label) | ||
{ | ||
return reinterpret_cast<gismo::gsOptionList*>(ol)->getInt(label); | ||
} | ||
|
||
GISMO_EXPORT double gsOptionList_getReal(gsCOptionList * ol, const char * label) | ||
{ | ||
return reinterpret_cast<gismo::gsOptionList*>(ol)->getReal(label); | ||
} | ||
|
||
GISMO_EXPORT int gsOptionList_getSwitch(gsCOptionList * ol, const char * label) | ||
{ | ||
return reinterpret_cast<gismo::gsOptionList*>(ol)->getSwitch(label); | ||
} | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
Oops, something went wrong.