Linking to tmtubes

This commit is contained in:
Anne de Jong 2014-11-11 09:31:13 +01:00
commit a534e46833
5 changed files with 134 additions and 0 deletions

52
CMakeLists.txt Normal file
View File

@ -0,0 +1,52 @@
# CMakeList.txt for linear code
cmake_minimum_required (VERSION 2.8.9)
project(Timedomain1DEuler)
add_definitions(-DTRACERNAME=timedomaineuler -DARMA_USE_BLAS -DARMA_USE_LAPACK)
############################## Not so often changed
# -pipe Use pipes rather than temporary files for communication
# between the various stages of compilation. This fails to
# work on some systems where the assembler is unable to
# read from a pipe; but the GNU assembler has no troubl.
# ${tubedrag}
set (CMAKE_GCC " -Wno-unused-function -ffunction-sections -fdata-sections -Wno-unused-local-typedefs -Wno-empty-body")
set (CMAKE_GENERAL "${CMAKE_GENERAL} -std=c++11 -pipe -fPIC -Wall \
-Wextra -Wno-unused-parameter \
-Wno-unused-variable -Wno-unused-but-set-variable \
-Wno-return-local-addr -Wno-cpp -Wno-address")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_GENERAL} ${CMAKE_GCC}")
link_directories(${link_directories} /usr/local/lib)
include_directories(
../tmtubes/src
../tmtubes/src/sys
../tmtubes/src/seg
../tmtubes/src/common
../tmtubes/src/common/gas
../tmtubes/src/common/bessel
../tmtubes/src/common/fsolve
../tmtubes/src/common/solid
../tmtubes/src/common/rottfuncs
)
AUX_SOURCE_DIRECTORY(src src)
link_directories(tmtubes/src/nonlinear tmtubes/src/common)
# set(src ${src} src/seg/geom.cpp src/sys/globalconf.cpp)
add_executable(timedomaineuler timedomain.cpp ${src})
target_link_libraries(timedomaineuler nonlin math_common blas lapack boost_iostreams boost_serialization)

25
src/solution.h Normal file
View File

@ -0,0 +1,25 @@
#pragma once
#ifndef _SOLUTION_H_
#define _SOLUTION_H_
#include "vtypes.h"
namespace td{
SPOILNAMESPACE
class Solution{
vd rho;
vd u;
vd e;
vd p;
public:
Solution(){}
~Solution(){}
};
} // namespace td
#endif /* _SOLUTION_H_ */

14
src/tube.cpp Normal file
View File

@ -0,0 +1,14 @@
#include "tube.h"
namespace td{
Tube::Tube(const segment::Geom& g):
geom(g),
gc(tasystem::Globalconf::airSTP(0,100,1))
{
}
};

26
src/tube.h Normal file
View File

@ -0,0 +1,26 @@
#pragma once
#ifndef _TUBE_H_
#define _TUBE_H_
#include "geom.h"
#include "globalconf.h"
#include "solution.h"
namespace td{
class Tube{
segment::Geom geom;
tasystem::Globalconf gc;
vector<Solution> sols;
public:
Tube(const segment::Geom& g);
Solution& getSol(int i=-1);
};
} // namespace td
#endif /* _TUBE_H_ */

17
timedomain.cpp Normal file
View File

@ -0,0 +1,17 @@
#include "geom.h"
#include "grid.h"
#include "tube.h"
using segment::Geom;
using segment::Grid;
int main(int argc,char *argv[]){
SPOILNAMESPACE
us gp=100;
d L=1;
Grid grid(gp,L);
d radius=1.0;
Geom g=Geom::CylinderBlApprox(grid,radius);
td::Tube t(g);
return 0;
}