Skip to content
Snippets Groups Projects
Commit 83bb6347 authored by Elias Pipping's avatar Elias Pipping
Browse files

[Build ] Migrate to CMake

parent b3c7111c
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@
#include <dune/fufem/boundarypatch.hh>
#pragma clang diagnostic pop
#include "../polyhedrondistance.hh"
#include <dune/tectonic/polyhedrondistance.hh>
#include "mygeometry.hh"
......
......@@ -2,8 +2,8 @@
#error MY_DIM unset
#endif
#include "explicitgrid.hh"
#include "explicitvectors.hh"
#include "../explicitgrid.hh"
#include "../explicitvectors.hh"
template class GridConstructor<Grid>;
......
......@@ -5,7 +5,7 @@
#include <dune/common/fvector.hh>
#include <dune/common/parametertree.hh>
#include "../polyhedrondistance.hh"
#include <dune/tectonic/polyhedrondistance.hh>
class PatchFunction
: public Dune::VirtualFunction<Dune::FieldVector<double, MY_DIM>,
......
......@@ -12,16 +12,16 @@
#undef HAVE_IPOPT
#endif
#ifndef datadir
#error datadir unset
#endif
#include <cmath>
#include <exception>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/format.hpp>
#include <dune/common/bitsetvector.hh>
#include <dune/common/exceptions.hh>
#include <dune/common/fmatrix.hh>
......@@ -77,17 +77,24 @@
size_t const dims = MY_DIM;
void initPython() {
void initPython(std::string dataDirectory) {
Python::start();
Python::run("import sys");
Python::run("sys.path.append('" datadir "')");
Python::run(str(boost::format("sys.path.append('%s')") % dataDirectory));
}
int main(int argc, char *argv[]) {
try {
auto const dataDirectory =
boost::filesystem::system_complete(boost::filesystem::path(argv[0]))
.parent_path() /
boost::filesystem::path("sand-wedge-data");
Dune::ParameterTree parset;
Dune::ParameterTreeParser::readINITree(datadir "/parset.cfg", parset);
Dune::ParameterTreeParser::readINITree(
(dataDirectory / boost::filesystem::path("parset.cfg")).string(),
parset);
Dune::ParameterTreeParser::readOptions(argc, argv, parset);
MyGeometry::render();
......@@ -167,7 +174,7 @@ int main(int argc, char *argv[]) {
using FunctionMap = SharedPointerMap<std::string, Function>;
FunctionMap functions;
{
initPython();
initPython(dataDirectory.string());
Python::import("boundaryconditions")
.get("Functions")
.toC<typename FunctionMap::Base>(functions);
......
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment