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

dg: correct Outside Boundary Condition

parent a3133053
Branches
Tags
No related merge requests found
...@@ -10,5 +10,5 @@ Line Loop(5) = {2, 3, 4, 1}; ...@@ -10,5 +10,5 @@ Line Loop(5) = {2, 3, 4, 1};
Plane Surface(6) = {5}; Plane Surface(6) = {5};
Physical Line("Border") = {1, 2, 3, 4}; Physical Line("Border") = {1, 2, 3, 4};
Physical Surface("Inside") = {6}; Physical Surface("Inside") = {6};
Transfinite Line {1, 2, 4, 3} = 2 Using Progression 1; //Transfinite Line {1, 2, 4, 3} = 2 Using Progression 1;
Transfinite Surface {6}; //Transfinite Surface {6};
...@@ -4,28 +4,25 @@ class dgBoundaryConditionOutsideValue : public dgBoundaryCondition { ...@@ -4,28 +4,25 @@ class dgBoundaryConditionOutsideValue : public dgBoundaryCondition {
dgConservationLaw &_claw; dgConservationLaw &_claw;
std::string _outsideValueFunctionName; std::string _outsideValueFunctionName;
class term : public dataCacheDouble { class term : public dataCacheDouble {
dataCacheMap cacheMapRight; // new cacheMap to pass to the Riemann solver
dataCacheDouble &solutionRight; dataCacheDouble &solutionRight;
dataCacheDouble &solutionLeft; dataCacheDouble &solutionLeft;
dataCacheDouble &outsideValue; dataCacheDouble &outsideValue;
dataCacheMap cacheMapRight; // new cacheMap to pass to the Riemann solver
dataCacheDouble *riemannSolver; dataCacheDouble *riemannSolver;
dgConservationLaw &_claw; dgConservationLaw &_claw;
public: public:
term(dgConservationLaw &claw, dataCacheMap &cacheMapLeft,const std::string outsideValueFunctionName): term(dgConservationLaw &claw, dataCacheMap &cacheMapLeft,const std::string outsideValueFunctionName):
dataCacheDouble(cacheMapLeft.getNbEvaluationPoints(),claw.nbFields()),
cacheMapRight(cacheMapLeft.getNbEvaluationPoints()),
solutionRight(cacheMapRight.provideData("Solution")), solutionRight(cacheMapRight.provideData("Solution")),
solutionLeft(cacheMapLeft.get("Solution",this)), solutionLeft(cacheMapLeft.get("Solution",this)),
outsideValue(cacheMapLeft.get(outsideValueFunctionName,this)), outsideValue(cacheMapLeft.get(outsideValueFunctionName,this)),
cacheMapRight(cacheMapLeft.getNbEvaluationPoints()),
_claw(claw) _claw(claw)
{ {
riemannSolver=_claw.newRiemannSolver(cacheMapLeft,cacheMapRight); riemannSolver=_claw.newRiemannSolver(cacheMapLeft,cacheMapRight);
} }
void _eval() { void _eval() {
if(_value.size1()!=solutionLeft().size1()){
//adjust sizes
_value = fullMatrix<double>(solutionLeft().size1(),_claw.nbFields());
}
solutionRight.set(outsideValue()); solutionRight.set(outsideValue());
if(riemannSolver){ if(riemannSolver){
for(int i=0;i<_value.size1(); i++) for(int i=0;i<_value.size1(); i++)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment