timedomainresonace/src/tube.h

57 lines
1.2 KiB
C
Raw Normal View History

// 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"
#include "globalconf.h"
2015-01-27 09:00:35 +00:00
namespace td {
2014-11-11 08:31:13 +00:00
2015-02-10 07:17:40 +00:00
typedef double d;
class Tube {
2015-02-22 08:54:36 +00:00
public:
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;
2014-11-11 08:31:13 +00:00
public:
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(); }
};
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-22 21:19:06 +00:00
};
class TubeMCM : public Tube { // Using Lax-Friedrichs method
protected:
virtual SolutionInstance Integrate(d dt);
public:
using Tube::Tube;
2015-01-27 09:00:35 +00:00
};
} // namespace td
#endif // TUBE_H
//////////////////////////////////////////////////////////////////////
2014-11-11 08:31:13 +00:00