Skip to content

Commit 76e385b

Browse files
committed
handle Vec<T,2> in more cases
1 parent 38bd28a commit 76e385b

4 files changed

Lines changed: 18 additions & 6 deletions

File tree

lib/vistle/alg/fields.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ class RemapImpl {
131131
out = remapDataTempl<T, 1, Mapping>(in1, mapping, inverse);
132132
}
133133
break;
134+
case 2:
135+
if (auto in2 = Vec<T, 2>::as(in)) {
136+
found = true;
137+
out = remapDataTempl<T, 2, Mapping>(in2, mapping, inverse);
138+
}
139+
break;
134140
case 3:
135141
if (auto in3 = Vec<T, 3>::as(in)) {
136142
found = true;

lib/vistle/vtkm/convert.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,17 @@ struct AddField {
237237
void operator()(S)
238238
{
239239
typedef Vec<S, 1> V1;
240-
//typedef Vec<S, 2> V2;
240+
typedef Vec<S, 2> V2;
241241
typedef Vec<S, 3> V3;
242242
//typedef Vec<S, 4> V4;
243243

244244
viskores::cont::UnknownArrayHandle ah;
245245
if (auto in = V1::as(object)) {
246246
ah = in->x().handle();
247+
} else if (auto in = V2::as(object)) {
248+
auto ax = in->x().handle();
249+
auto ay = in->y().handle();
250+
ah = viskores::cont::make_ArrayHandleSOA(ax, ay);
247251
} else if (auto in = V3::as(object)) {
248252
auto ax = in->x().handle();
249253
auto ay = in->y().handle();

module/filter/SplitDimensions/SplitDimensions.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ bool SplitDimensions::compute(const std::shared_ptr<BlockTask> &task) const
6363
return true;
6464
}
6565

66-
vistle::Points::ptr out0d(new vistle::Points(size_t(0)));
66+
vistle::Points::ptr out0d;
6767
if (isConnected(*p_out[0])) {
6868
out0d.reset(new vistle::Points(size_t(0)));
6969
}
@@ -113,12 +113,12 @@ bool SplitDimensions::compute(const std::shared_ptr<BlockTask> &task) const
113113

114114
switch (type) {
115115
case cell::POINT:
116-
if (out0d) {
116+
if (out0d && !ugrid->isGhost(e)) {
117117
Index v = icl[begin];
118118
vm[0][v] = npoint++;
119119
out0d->d()->x[0]->push_back(ugrid->x()[v]);
120120
out0d->d()->x[1]->push_back(ugrid->y()[v]);
121-
out0d->d()->x[2]->push_back(ugrid->y()[v]);
121+
out0d->d()->x[2]->push_back(ugrid->z()[v]);
122122
}
123123
break;
124124
case cell::BAR:
@@ -188,6 +188,7 @@ bool SplitDimensions::compute(const std::shared_ptr<BlockTask> &task) const
188188
#endif
189189
}
190190

191+
const bool reuseCoord = p_reuse->getValue();
191192
Object::ptr obj;
192193
for (int d = 0; d <= 3; ++d) {
193194
if (d == 0)
@@ -196,10 +197,10 @@ bool SplitDimensions::compute(const std::shared_ptr<BlockTask> &task) const
196197
obj = out[d];
197198
if (!obj)
198199
continue;
200+
updateMeta(obj);
199201
if (!data) {
200-
updateMeta(obj);
201202
task->addObject(p_out[d], obj);
202-
} else if (vm[d].empty()) {
203+
} else if (reuseCoord && vm[d].empty()) {
203204
DataBase::ptr dout = data->clone();
204205
dout->setGrid(out[d]);
205206
updateMeta(dout);

module/map/BoundingBox/BoundingBox.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ bool Extrema::compute()
389389
handled = true;
390390
} else {
391391
boost::mpl::for_each<Scalars>(Compute<1>(obj, this));
392+
boost::mpl::for_each<Scalars>(Compute<2>(obj, this));
392393
boost::mpl::for_each<Scalars>(Compute<3>(obj, this));
393394
}
394395

0 commit comments

Comments
 (0)