diff --git a/Common/LuaBindings.cpp b/Common/LuaBindings.cpp index 71157cadbc6035bd259183238cd871638d5bb0a1..f0e3bc9df306ebce9cf58262cba86c75e988ce03 100644 --- a/Common/LuaBindings.cpp +++ b/Common/LuaBindings.cpp @@ -20,6 +20,7 @@ #include "dgConservationLawWaveEquation.h" #include "dgRungeKutta.h" #include "dgSystemOfEquations.h" +#include "dgLimiter.h" extern "C" { #include "lua.h" @@ -282,6 +283,8 @@ binding::binding(){ DocRecord::registerBindings(this); GEntity::registerBindings(this); GFace::registerBindings(this); + dgLimiter::registerBindings(this); + dgSlopeLimiter::registerBindings(this); } binding *binding::_instance=NULL; #endif diff --git a/Solver/TESTCASES/RayleighTaylor.lua b/Solver/TESTCASES/RayleighTaylor.lua index f51fe544d922a1fce2d05c430630b5d0254eeb76..04c9f18298bb9ec457176bec238fb596d383b8e2 100644 --- a/Solver/TESTCASES/RayleighTaylor.lua +++ b/Solver/TESTCASES/RayleighTaylor.lua @@ -72,7 +72,7 @@ law:addBoundaryCondition('Top',law:newOutsideValueBoundary(FS)) GC=dgGroupCollection(myModel,2,order) solution=dgDofContainer(GC,4) solution:L2Projection(FS) -limiter=dgSlopeLimiter(law) +limiter = dgSlopeLimiter(law) -- limiter:apply(solution) GC:buildGroupsOfInterfaces(myModel,2,order) diff --git a/Solver/dgLimiter.cpp b/Solver/dgLimiter.cpp index b21fd1b79783eb635b1c0fece8a7f7f0b62235e4..518674751dc7900bd915bcaf14c29441ceb396cf 100644 --- a/Solver/dgLimiter.cpp +++ b/Solver/dgLimiter.cpp @@ -4,7 +4,7 @@ #include "function.h" //---------------------------------------------------------------------------------- -bool dgSlopeLimiter::apply ( dgDofContainer *solution) +int dgSlopeLimiter::apply ( dgDofContainer *solution) { dgGroupCollection *groups=solution->getGroups(); solution->scatter(); @@ -118,7 +118,7 @@ bool dgSlopeLimiter::apply ( dgDofContainer *solution) } } } - return true; + return 1; } #include "Bindings.h" @@ -127,9 +127,9 @@ void dgLimiter::registerBindings(binding *b) { classBinding *cb = b->addClass<dgLimiter>("dgLimiter"); cb->setDescription("Parent class for limiters"); methodBinding *cm; -// cm = cb->addMethod("apply",&dgLimiter::apply); -// cm->setArgNames("solution",NULL); -// cm->setDescription("apply the limiter on the solution"); + cm = cb->addMethod("apply",&dgLimiter::apply); + cm->setArgNames("solution",NULL); + cm->setDescription("apply the limiter on the solution"); } void dgSlopeLimiter::registerBindings(binding *b) { @@ -139,5 +139,6 @@ void dgSlopeLimiter::registerBindings(binding *b) { cm = cb->setConstructor<dgSlopeLimiter,dgConservationLaw *>(); cm->setDescription("A new explicit slope limiter"); cm->setArgNames("law",NULL); + cb->setParentClass<dgLimiter>(); } diff --git a/Solver/dgLimiter.h b/Solver/dgLimiter.h index f0c115337f4493da96e5a2422687d0602f665d94..5e4072beae20dc5e1622ad7f753ae4bdf2af25bd 100644 --- a/Solver/dgLimiter.h +++ b/Solver/dgLimiter.h @@ -13,14 +13,14 @@ protected: dgConservationLaw *_claw; public: dgLimiter (dgConservationLaw *claw) : _claw(claw) {} - virtual bool apply ( dgDofContainer *sol)=0; + virtual int apply ( dgDofContainer *sol)=0; static void registerBindings(binding *b); }; class dgSlopeLimiter : public dgLimiter{ public : dgSlopeLimiter (dgConservationLaw *claw) : dgLimiter (claw) {} - virtual bool apply ( dgDofContainer *solution); + virtual int apply ( dgDofContainer *solution); static void registerBindings(binding *b); };