Skip to content
Snippets Groups Projects
Commit f24982a5 authored by Jean-François Remacle's avatar Jean-François Remacle
Browse files

ugly fix for bindings on MAC ... yet it works

parent a061bb26
No related branches found
No related tags found
No related merge requests found
......@@ -1380,12 +1380,17 @@ void GModel::save(std::string fileName){
#ifdef HAVE_LUA
#include "Bindings.h"
static GModel *myConstructorPtr(){
return new GModel;
}
void GModel::registerBindings(binding *b){
classBinding *cb = b->addClass<GModel>("GModel");
methodBinding *cm;
cm = cb->addMethod("mesh",&GModel::mesh);
cm = cb->addMethod("load",&GModel::load);
cm = cb->addMethod("save",&GModel::save);
cb->setConstructor(constructorPtr<GModel>);
// cb->setConstructor(constructorPtr<GModel>);
// FIXME AGAIN !!!!!!!! JF
cb->setConstructor(myConstructorPtr);
}
#endif
......@@ -292,6 +292,12 @@ bool fullMatrix<double>::svd(fullMatrix<double> &V, fullVector<double> &S)
#endif
#include "Bindings.h"
// I DID FIX IT FOR NOW ... SHOULD BE BETTER -- JF
static fullMatrix<double> *myConstructorPtr(int a0, int a1){
return new fullMatrix<double>(a0,a1);
}
template<>
void fullMatrix<double>::registerBindings(binding *b){
classBinding *cb = b->addClass<fullMatrix<double> >("fullMatrix");
......@@ -302,5 +308,6 @@ void fullMatrix<double>::registerBindings(binding *b){
cb->addMethod("set",&fullMatrix<double>::set);
cb->addMethod("gemm",&fullMatrix<double>::gemm);
// FIXME DOES NOT COMPILE ON MAC
cb->setConstructor(constructorPtr<fullMatrix<double>,int,int>);
cb->setConstructor(myConstructorPtr);
// cb->setConstructor(constructorPtr<fullMatrix<double>,int,int>);
}
......@@ -71,8 +71,6 @@ void dgConservationLaw::registerBindings(binding *b){
cb->addMethod("newOutsideValueBoundary",&dgConservationLaw::newOutsideValueBoundary);
}
void dgBoundaryCondition::registerBindings(binding *b){
classBinding *cb = b->addClass<dgBoundaryCondition>("dgBoundaryCondition");
}
......@@ -95,8 +95,13 @@ dgConservationLawAdvection::dgConservationLawAdvection(std::string vFunctionName
#include "Bindings.h"
static dgConservationLawAdvection *myConstructorPtr(std::string a,std::string b){
return new dgConservationLawAdvection(a,b);
}
void dgConservationLawAdvectionRegisterBindings (binding *b){
classBinding *cb = b->addClass<dgConservationLawAdvection>("dgConservationLawAdvection");
cb->setConstructor(constructorPtr<dgConservationLawAdvection,std::string,std::string>);
// cb->setConstructor(constructorPtr<dgConservationLawAdvection,std::string,std::string>);
cb->setConstructor(myConstructorPtr);
cb->setParentClass<dgConservationLaw>();
}
......@@ -312,10 +312,15 @@ class dgBoundaryConditionPerfectGasLaw2dFreeStream : public dgBoundaryCondition
#include "Bindings.h"
static dgPerfectGasLaw2d *myConstructorPtr(){
return new dgPerfectGasLaw2d ;
}
void dgPerfectGasLaw2dRegisterBindings (binding *b){
classBinding *cb = b->addClass<dgPerfectGasLaw2d>("dgPerfectGasLaw2d");
methodBinding *cm;
cb->addMethod("newWallBoundary",&dgPerfectGasLaw2d::newWallBoundary);
cb->setConstructor(constructorPtr<dgPerfectGasLaw2d>);
// cb->setConstructor(constructorPtr<dgPerfectGasLaw2d>);
cb->setConstructor(myConstructorPtr);
cb->setParentClass<dgConservationLaw>();
}
......@@ -141,10 +141,14 @@ dgBoundaryCondition *dgConservationLawShallowWater2d::newBoundaryWall(){
}
#include "Bindings.h"
static dgConservationLawShallowWater2d *myConstructorPtr(){
return new dgConservationLawShallowWater2d;
}
void dgConservationLawShallowWater2dRegisterBindings (binding *b){
classBinding *cb = b->addClass<dgConservationLawShallowWater2d>("dgConservationLawShallowWater2d");
methodBinding *cm;
cb->addMethod("newBoundaryWall",&dgConservationLawShallowWater2d::newBoundaryWall);
cb->setConstructor(constructorPtr<dgConservationLawShallowWater2d>);
// cb->setConstructor(constructorPtr<dgConservationLawShallowWater2d>);
cb->setConstructor(myConstructorPtr);
cb->setParentClass<dgConservationLaw>();
}
......@@ -136,10 +136,14 @@ dgBoundaryCondition *dgConservationLawWaveEquation::newBoundaryWall()const{
}
#include "Bindings.h"
static dgConservationLawWaveEquation *myConstructorPtr(int d){
return new dgConservationLawWaveEquation (d);
}
void dgConservationLawWaveEquationRegisterBindings(binding *b){
classBinding *cb = b->addClass<dgConservationLawWaveEquation> ("dgConservationLawWaveEquation");
methodBinding *cm;
cb->addMethod("newBoundaryWall",&dgConservationLawWaveEquation::newBoundaryWall);
cb->setConstructor(constructorPtr<dgConservationLawWaveEquation,int>);
// cb->setConstructor(constructorPtr<dgConservationLawWaveEquation,int>);
cb->setConstructor(myConstructorPtr);
cb->setParentClass<dgConservationLaw>();
}
......@@ -38,14 +38,19 @@ void dgSystemOfEquations::setConservationLaw (dgConservationLaw *law){
}
#include "Bindings.h"
static dgSystemOfEquations *myConstructorPtr(GModel* gm){
return new dgSystemOfEquations(gm);
}
void dgSystemOfEquations::registerBindings(binding *b){
classBinding *cb = b->addClass<dgSystemOfEquations>("dgSystemOfEquations");
cb->setDescription("a class to rule them all :-) -- bad description, this class will be removed anyway");
cb->setConstructor(constructorPtr<dgSystemOfEquations,GModel*>);
cb->setConstructor(myConstructorPtr);
methodBinding *cm;
cm = cb->addMethod("setConservationLaw",&dgSystemOfEquations::setConservationLaw);
cm->setArgNames("law",NULL);
cm->setDescription("set the conservation law this system solve");
cm->setDescription("set the conservation law this system solves");
cm = cb->addMethod("setup",&dgSystemOfEquations::setup);
cm->setDescription("allocate and init internal stuff, call this function after setOrder and setLaw and before anything else on this instance");
cm = cb->addMethod("exportSolution",&dgSystemOfEquations::exportSolution);
......
......@@ -147,11 +147,15 @@ void function::registerDefaultFunctions()
function::add("XYZ", new functionXYZ);
}
static functionConstant *myConstructorPtr(fullMatrix<double>*m){
return new functionConstant(m);
}
void function::registerBindings(binding *b){
classBinding *cb = b->addClass<function>("function");
cb->addMethod("getName",&function::getName);
cb = b->addClass<functionConstant>("functionConstant");
cb->setConstructor(constructorPtr<functionConstant,fullMatrix<double>*>);
cb->setConstructor(myConstructorPtr);
// cb->setConstructor(constructorPtr<functionConstant,fullMatrix<double>*>);
cb->setParentClass<function>();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment