Skip to content

Commit 31f10d3

Browse files
committed
7
1 parent 8906d23 commit 31f10d3

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

simulators/7_self_contact/src/BarrierEnergy.cu

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ BarrierEnergy<T, dim>::BarrierEnergy(const BarrierEnergy<T, dim> &rhs)
3535
: pimpl_{std::make_unique<Impl>(*rhs.pimpl_)} {}
3636

3737
template <typename T, int dim>
38-
BarrierEnergy<T, dim>::BarrierEnergy(const std::vector<T> &x, const std::vector<T> &n, const std::vector<T> &o, const std::vector<int> &be, const std::vector<int> &bp, const std::vector<T> &contact_area) : pimpl_{std::make_unique<Impl>()}
38+
BarrierEnergy<T, dim>::BarrierEnergy(const std::vector<T> &x, const std::vector<T> &n, const std::vector<T> &o, const std::vector<int> &bp, const std::vector<int> &be, const std::vector<T> &contact_area) : pimpl_{std::make_unique<Impl>()}
3939
{
4040
pimpl_->N = x.size() / dim;
4141
pimpl_->device_x.copy_from(x);
@@ -377,12 +377,13 @@ T BarrierEnergy<T, dim>::init_step_size(const DeviceBuffer<T> &p)
377377
e1<<device_x(eI1*dim),device_x(eI1*dim+1);
378378
dp<<P(xI*dim),P(xI*dim+1);
379379
de0<<P(eI0*dim),P(eI0*dim+1);
380-
de1<<P(eI1*dim),P(eI1*dim+1);
381-
if (bbox_overlap(p,e0,e1,dp,de0,de1,current_alpha)){
382-
//printf("bbox_overlap at %d %d\n",xI,i);
383-
T toc=narrow_phase_CCD(p,e0,e1,dp,de0,de1,current_alpha);
384-
device_alpha1(i)=min(device_alpha1(i),toc);
385-
}} })
380+
de1<<P(eI1*dim),P(eI1*dim+1);
381+
if (bbox_overlap(p, e0, e1, dp, de0, de1, current_alpha))
382+
{
383+
T toc = narrow_phase_CCD(p, e0, e1, dp, de0, de1, current_alpha);
384+
device_alpha1(i) = min(device_alpha1(i), toc);
385+
}
386+
} })
386387
.wait();
387388
return min(min_vector(device_alpha1), current_alpha);
388389
}

simulators/7_self_contact/src/distance/CCD.cu

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ __device__ __host__ bool bbox_overlap(const Eigen::Matrix<T, 2, 1> &p, const Eig
1515
}
1616
else
1717
{
18-
// printf("min_p: %f %f\n max_p: %f %f\n min_e: %f %f\n max_e: %f %f\n", min_p[0], min_p[1], max_p[0], max_p[1], min_e[0], min_e[1], max_e[0], max_e[1]);
1918
return true;
2019
}
2120
}

simulators/7_self_contact/src/simulator.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ InvFreeSimulator<T, dim>::Impl::Impl(T rho, T side_len, T initial_stretch, T K,
6464
generate(side_len, n_seg, x, e);
6565
for (int i = 0; i < (n_seg + 1) * (n_seg + 1); i++)
6666
{
67-
x.push_back(x[i * dim] - side_len * 0.1);
67+
x.push_back(x[i * dim] - side_len * 0.05);
6868
x.push_back(x[i * dim + 1] - side_len * 1.1);
6969
}
7070
int esize = e.size();

0 commit comments

Comments
 (0)