Commit e6091d1d authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

add conservation law sediment bottom

parent 6a1c531e
Pipeline #1990 failed with stage
in 31 minutes and 35 seconds
set(SRC
dgConservationLawSedimentBottom.cpp
dgConservationLawShallowWater1d.cpp
dgConservationLawShallowWater2d.cpp
dgConservationLawShallowWater2dC.cpp
......
#include "dgConservationLawSedimentBottom.h"
#include "functor.h"
void dgConservationLawSedimentBottom::gradPsiTermCB(functorCache &m, fullMatrix<double> &val)const{
const fullMatrix<double> &s = m.get(*_s);
for(int i=0; i< m.nEvaluationPoint(); i++) {
val(i,0) = s(i,0);
val(i,1) = s(i,1);
val(i,2) = 0.;
}
}
void dgConservationLawSedimentBottom::interfaceTermCB(functorCache &m, fullMatrix<double>&val) const {
const fullMatrix<double> &sL = m.get(*_s, 0);
const fullMatrix<double> &sR = m.get(*_s, 1);
const fullMatrix<double> &nL = m.get(*functor::getNormals(), 0);
const fullMatrix<double> &nR = m.get(*functor::getNormals(),1);
val.resize(m.nEvaluationPoint(), 2);
for(int i=0; i< m.nEvaluationPoint(); i++) {
val(i,0) = -(sL(i,0)*nL(i,0)+sL(i,1)*nL(i,1)+sR(i,0)*nR(i,0)+sR(i,1)*nR(i,1))/2;
}
}
dgBoundaryCondition *dgConservationLawSedimentBottom::newBoundaryOpen(){
return newSymmetryBoundary();
}
dgBoundaryCondition *dgConservationLawSedimentBottom::newBoundaryWall(){
return new0FluxBoundary();
}
dgConservationLawSedimentBottom::dgConservationLawSedimentBottom(const functor *s) : dgConservationLawFunction(1), _s(s) {
_volumeTerm1[""] = newFunctorMember(*this, &dgConservationLawSedimentBottom::gradPsiTermCB);
_interfaceTerm0[""] = newFunctorMember(*this, &dgConservationLawSedimentBottom::interfaceTermCB);
}
dgConservationLawSedimentBottom::~dgConservationLawSedimentBottom () {
}
#ifndef _DG_CONSERVATION_LAW_SHALLOW_WATER_SEDIMENT_BOTTOM_
#define _DG_CONSERVATION_LAW_SHALLOW_WATER_SEDIMENT_BOTTOM_
#include "dgConservationLawFunction.h"
#include "dgDofContainer.h"
/**The 1D tracer equation consistent with the dgConservationLaw2d */
class dgConservationLawSedimentBottom : public dgConservationLawFunction {
const functor *_s;
public:
void gradPsiTermCB(functorCache &m, fullMatrix<double> &val) const;
void interfaceTermCB(functorCache &m, fullMatrix<double> &val) const;
bool isConstantJac() const {return true;}
bool isLinear() const {return true;}
dgBoundaryCondition *newBoundaryWall();
dgBoundaryCondition *newBoundaryOpen();
dgConservationLawSedimentBottom(const functor *s);
~dgConservationLawSedimentBottom();
};
#endif
......@@ -2,6 +2,7 @@
%{
#undef HAVE_DLOPEN
#include "dgConservationLawSedimentBottom.h"
#include "dgConservationLawShallowWater1d.h"
#include "dgConservationLawShallowWater2d.h"
#include "dgConservationLawShallowWater2dC.h"
......@@ -19,6 +20,7 @@
%import(module="dgpy.conservationLaw") "dgConservationLawFunction.h";
//%import(module="dgpy.timeIntegrator") "dgAssemblerExplicit.h";
%include "dgConservationLawSedimentBottom.h"
%include "dgConservationLawShallowWater1d.h"
%include "dgConservationLawShallowWater2d.h"
%include "dgConservationLawShallowWater2dC.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment