aboutsummaryrefslogtreecommitdiff
path: root/CarpetDev/CarpetIOF5/src/iof5.hh
diff options
context:
space:
mode:
Diffstat (limited to 'CarpetDev/CarpetIOF5/src/iof5.hh')
-rw-r--r--CarpetDev/CarpetIOF5/src/iof5.hh16
1 files changed, 15 insertions, 1 deletions
diff --git a/CarpetDev/CarpetIOF5/src/iof5.hh b/CarpetDev/CarpetIOF5/src/iof5.hh
index a450ae812..7202140ba 100644
--- a/CarpetDev/CarpetIOF5/src/iof5.hh
+++ b/CarpetDev/CarpetIOF5/src/iof5.hh
@@ -141,6 +141,19 @@ namespace CarpetIOF5 {
return res;
}
+ template<typename T, int D>
+ static inline
+ vect<T,D> filter(vect<T,D> const& a, vect<bool,D> const& c,
+ T const& fill = T(0))
+ {
+ vect<T,D> r(fill);
+ int ri=0;
+ for (int ai=0; ai<dim; ++ai) {
+ if (c[ai]) r[ri++] = a[ai];
+ }
+ return r;
+ }
+
static inline
F5_vec3_point_t v2p(rvect const& a)
{
@@ -241,7 +254,8 @@ namespace CarpetIOF5 {
string
generate_topologyname(cGH const *const cctkGH,
int const gi,
- ivect const& reffact);
+ ivect const& reffact,
+ ivect const& slice_ipos);
// Generate a good chart name (tensor basis name)
string