aboutsummaryrefslogtreecommitdiff
path: root/Carpet/Requirements
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2013-04-04 11:38:08 +0200
committerIan Hinder <ian.hinder@aei.mpg.de>2013-04-04 11:38:08 +0200
commit77c63671c5e3b2d51c9ff22891dc1e64ffd9452f (patch)
treee553a0a4544b6c44503b208dbeefc326ef136ba5 /Carpet/Requirements
parent95558fa30a530d677723f63ee813f1d1fc029161 (diff)
Requirements: Move location class to a separate file
Diffstat (limited to 'Carpet/Requirements')
-rw-r--r--Carpet/Requirements/src/Requirements.cc29
-rw-r--r--Carpet/Requirements/src/location.cc13
-rw-r--r--Carpet/Requirements/src/location.hh30
-rw-r--r--Carpet/Requirements/src/make.code.defn2
4 files changed, 46 insertions, 28 deletions
diff --git a/Carpet/Requirements/src/Requirements.cc b/Carpet/Requirements/src/Requirements.cc
index 19a67f9fd..538c96188 100644
--- a/Carpet/Requirements/src/Requirements.cc
+++ b/Carpet/Requirements/src/Requirements.cc
@@ -21,6 +21,7 @@
#include <all_clauses.hh>
#include <clause.hh>
#include <clauses.hh>
+#include <location.hh>
#include <util.hh>
using namespace std;
@@ -53,33 +54,7 @@ namespace Requirements {
bool there_was_an_error = false;
bool there_was_a_warning = false;
- // Struct defining a location of a grid point
- struct location_t {
- int it, vi, tl, rl, m;
- char const* info;
- location_t():
- it(-1), vi(-1), tl(-1), rl(-1), m(-1), info("")
- {}
- location_t(int _it, int _vi, int _tl, int _rl, int _m, char const* _info):
- it(_it), vi(_vi), tl(_tl), rl(_rl), m(_m), info(_info)
- {}
- // Output helper
- void output (ostream& os) const;
- };
-
- inline ostream& operator<< (ostream& os, const location_t& a) {
- a.output(os);
- return os;
- }
-
- void location_t::output(ostream& os) const
- {
- os << "vi:" << vi << ",it:" << it << ", ";
- os << "[rl:" << rl << ",";
- os << "tl:" << tl << ",";
- os << "m:" << m << "]";
- }
-
+
// Represents which have valid information and which do not.
// This will later be indexed by rl, map etc.
// Currently only works with unigrid.
diff --git a/Carpet/Requirements/src/location.cc b/Carpet/Requirements/src/location.cc
new file mode 100644
index 000000000..d4c8aef4d
--- /dev/null
+++ b/Carpet/Requirements/src/location.cc
@@ -0,0 +1,13 @@
+#include <location.hh>
+#include <iostream>
+
+namespace Requirements {
+
+ void location_t::output(ostream& os) const
+ {
+ os << "vi:" << vi << ",it:" << it << ", ";
+ os << "[rl:" << rl << ",";
+ os << "tl:" << tl << ",";
+ os << "m:" << m << "]";
+ }
+}
diff --git a/Carpet/Requirements/src/location.hh b/Carpet/Requirements/src/location.hh
new file mode 100644
index 000000000..3ee79cd01
--- /dev/null
+++ b/Carpet/Requirements/src/location.hh
@@ -0,0 +1,30 @@
+#ifndef LOCATION_HH
+#define LOCATION_HH
+
+#include <iostream>
+
+namespace Requirements {
+
+ using namespace std;
+
+ // Struct defining a location of a grid point
+ struct location_t {
+ int it, vi, tl, rl, m;
+ char const* info;
+ location_t():
+ it(-1), vi(-1), tl(-1), rl(-1), m(-1), info("")
+ {}
+ location_t(int _it, int _vi, int _tl, int _rl, int _m, char const* _info):
+ it(_it), vi(_vi), tl(_tl), rl(_rl), m(_m), info(_info)
+ {}
+ // Output helper
+ void output (ostream& os) const;
+ };
+
+ inline ostream& operator<< (ostream& os, const location_t& a) {
+ a.output(os);
+ return os;
+ }
+}
+
+#endif
diff --git a/Carpet/Requirements/src/make.code.defn b/Carpet/Requirements/src/make.code.defn
index d2197a8d8..e9acc3f35 100644
--- a/Carpet/Requirements/src/make.code.defn
+++ b/Carpet/Requirements/src/make.code.defn
@@ -1,7 +1,7 @@
# Main make.code.defn file for thorn Requirements -*-Makefile-*-
# Source files in this directory
-SRCS = Requirements.cc clause.cc clauses.cc util.cc all_clauses.cc
+SRCS = Requirements.cc clause.cc clauses.cc util.cc all_clauses.cc location.cc
# Subdirectories containing source files
SUBDIRS =