2015-02-21 18:46:54 +00:00
|
|
|
// tube.h
|
|
|
|
//
|
|
|
|
// Author: J.A. de Jong
|
|
|
|
//
|
|
|
|
// Description:
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#pragma once
|
|
|
|
#ifndef TUBE_H
|
|
|
|
#define TUBE_H 1
|
2014-11-11 08:31:13 +00:00
|
|
|
|
2015-02-10 07:17:40 +00:00
|
|
|
#include "solutioninstance.h"
|
2015-02-10 09:07:29 +00:00
|
|
|
#include "globalconf.h"
|
2015-01-27 09:00:35 +00:00
|
|
|
|
2015-02-21 18:46:54 +00:00
|
|
|
namespace td {
|
2014-11-11 08:31:13 +00:00
|
|
|
|
2015-02-10 07:17:40 +00:00
|
|
|
typedef double d;
|
|
|
|
|
2015-02-21 18:46:54 +00:00
|
|
|
class Tube {
|
2015-02-22 08:54:36 +00:00
|
|
|
public:
|
2015-02-21 18:46:54 +00:00
|
|
|
d dx, L; // Grid spacing, total length
|
|
|
|
int gp; // Number of gridpoints
|
2015-01-27 09:00:35 +00:00
|
|
|
SolutionInstance sol; // Solutions at time instances
|
|
|
|
d pleft(d t); // Compute pressure bc
|
2015-02-22 21:19:06 +00:00
|
|
|
virtual SolutionInstance Integrate(d dt) = 0;
|
2015-02-21 18:46:54 +00:00
|
|
|
|
2014-11-11 08:31:13 +00:00
|
|
|
public:
|
2015-02-21 18:46:54 +00:00
|
|
|
Tube(double L, int gp) throw(int);
|
|
|
|
virtual ~Tube() {}
|
|
|
|
SolutionInstance &getSol() { return sol; }
|
|
|
|
void setSol(const SolutionInstance &sol) { this->sol = sol; }
|
|
|
|
void DoIntegration(d dt, int n = 1);
|
2015-02-22 21:19:06 +00:00
|
|
|
d getTime() { return sol.getTime(); }
|
2015-02-21 18:46:54 +00:00
|
|
|
};
|
|
|
|
class TubeLF : public Tube { // Using Lax-Friedrichs method
|
|
|
|
protected:
|
2015-02-22 21:19:06 +00:00
|
|
|
virtual SolutionInstance Integrate(d dt);
|
|
|
|
public:
|
|
|
|
using Tube::Tube;
|
2015-02-21 18:46:54 +00:00
|
|
|
|
2015-02-22 21:19:06 +00:00
|
|
|
};
|
|
|
|
class TubeMCM : public Tube { // Using Lax-Friedrichs method
|
|
|
|
protected:
|
|
|
|
virtual SolutionInstance Integrate(d dt);
|
2015-02-21 18:46:54 +00:00
|
|
|
public:
|
|
|
|
using Tube::Tube;
|
|
|
|
|
2015-01-27 09:00:35 +00:00
|
|
|
};
|
2015-02-21 18:46:54 +00:00
|
|
|
} // namespace td
|
|
|
|
|
|
|
|
|
|
|
|
#endif // TUBE_H
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
2014-11-11 08:31:13 +00:00
|
|
|
|