Skip to content
Snippets Groups Projects
Commit 5a046214 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

bindings for dgSlopeLimite (no bool in lua)

parent eaef33a5
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "dgConservationLawWaveEquation.h" #include "dgConservationLawWaveEquation.h"
#include "dgRungeKutta.h" #include "dgRungeKutta.h"
#include "dgSystemOfEquations.h" #include "dgSystemOfEquations.h"
#include "dgLimiter.h"
extern "C" { extern "C" {
#include "lua.h" #include "lua.h"
...@@ -282,6 +283,8 @@ binding::binding(){ ...@@ -282,6 +283,8 @@ binding::binding(){
DocRecord::registerBindings(this); DocRecord::registerBindings(this);
GEntity::registerBindings(this); GEntity::registerBindings(this);
GFace::registerBindings(this); GFace::registerBindings(this);
dgLimiter::registerBindings(this);
dgSlopeLimiter::registerBindings(this);
} }
binding *binding::_instance=NULL; binding *binding::_instance=NULL;
#endif #endif
...@@ -72,7 +72,7 @@ law:addBoundaryCondition('Top',law:newOutsideValueBoundary(FS)) ...@@ -72,7 +72,7 @@ law:addBoundaryCondition('Top',law:newOutsideValueBoundary(FS))
GC=dgGroupCollection(myModel,2,order) GC=dgGroupCollection(myModel,2,order)
solution=dgDofContainer(GC,4) solution=dgDofContainer(GC,4)
solution:L2Projection(FS) solution:L2Projection(FS)
limiter=dgSlopeLimiter(law) limiter = dgSlopeLimiter(law)
-- limiter:apply(solution) -- limiter:apply(solution)
GC:buildGroupsOfInterfaces(myModel,2,order) GC:buildGroupsOfInterfaces(myModel,2,order)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include "function.h" #include "function.h"
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
bool dgSlopeLimiter::apply ( dgDofContainer *solution) int dgSlopeLimiter::apply ( dgDofContainer *solution)
{ {
dgGroupCollection *groups=solution->getGroups(); dgGroupCollection *groups=solution->getGroups();
solution->scatter(); solution->scatter();
...@@ -118,7 +118,7 @@ bool dgSlopeLimiter::apply ( dgDofContainer *solution) ...@@ -118,7 +118,7 @@ bool dgSlopeLimiter::apply ( dgDofContainer *solution)
} }
} }
} }
return true; return 1;
} }
#include "Bindings.h" #include "Bindings.h"
...@@ -127,9 +127,9 @@ void dgLimiter::registerBindings(binding *b) { ...@@ -127,9 +127,9 @@ void dgLimiter::registerBindings(binding *b) {
classBinding *cb = b->addClass<dgLimiter>("dgLimiter"); classBinding *cb = b->addClass<dgLimiter>("dgLimiter");
cb->setDescription("Parent class for limiters"); cb->setDescription("Parent class for limiters");
methodBinding *cm; methodBinding *cm;
// cm = cb->addMethod("apply",&dgLimiter::apply); cm = cb->addMethod("apply",&dgLimiter::apply);
// cm->setArgNames("solution",NULL); cm->setArgNames("solution",NULL);
// cm->setDescription("apply the limiter on the solution"); cm->setDescription("apply the limiter on the solution");
} }
void dgSlopeLimiter::registerBindings(binding *b) { void dgSlopeLimiter::registerBindings(binding *b) {
...@@ -139,5 +139,6 @@ void dgSlopeLimiter::registerBindings(binding *b) { ...@@ -139,5 +139,6 @@ void dgSlopeLimiter::registerBindings(binding *b) {
cm = cb->setConstructor<dgSlopeLimiter,dgConservationLaw *>(); cm = cb->setConstructor<dgSlopeLimiter,dgConservationLaw *>();
cm->setDescription("A new explicit slope limiter"); cm->setDescription("A new explicit slope limiter");
cm->setArgNames("law",NULL); cm->setArgNames("law",NULL);
cb->setParentClass<dgLimiter>();
} }
...@@ -13,14 +13,14 @@ protected: ...@@ -13,14 +13,14 @@ protected:
dgConservationLaw *_claw; dgConservationLaw *_claw;
public: public:
dgLimiter (dgConservationLaw *claw) : _claw(claw) {} dgLimiter (dgConservationLaw *claw) : _claw(claw) {}
virtual bool apply ( dgDofContainer *sol)=0; virtual int apply ( dgDofContainer *sol)=0;
static void registerBindings(binding *b); static void registerBindings(binding *b);
}; };
class dgSlopeLimiter : public dgLimiter{ class dgSlopeLimiter : public dgLimiter{
public : public :
dgSlopeLimiter (dgConservationLaw *claw) : dgLimiter (claw) {} dgSlopeLimiter (dgConservationLaw *claw) : dgLimiter (claw) {}
virtual bool apply ( dgDofContainer *solution); virtual int apply ( dgDofContainer *solution);
static void registerBindings(binding *b); static void registerBindings(binding *b);
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment