本文整理汇总了C++中eigen::Vector3d::fill方法的典型用法代码示例。如果您正苦于以下问题:C++ Vector3d::fill方法的具体用法?C++ Vector3d::fill怎么用?C++ Vector3d::fill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eigen::Vector3d
的用法示例。
在下文中一共展示了Vector3d::fill方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calForcesHelper
void Model::calForcesHelper(int i, int j, Eigen::Vector3d &F) {
double dist;
Eigen::Vector3d r;
dist = 0.0;
F.fill(0);
r = particles[j]->r - particles[i]->r;
dist = r.norm();
if (dist < 2.0) {
std::cerr << "overlap " << i << "\t" << j << "\t"<< this->timeCounter << "dist: " << dist << "\t" << this->timeCounter <<std::endl;
#ifdef OPENMP
std::cerr << "report from thread: " << omp_get_thread_num() << std::endl;
std::cerr << "number of threads: " << omp_get_num_threads() << std::endl;
#endif
dist = 2.06;
}
if (dist < cutoff) {
// the unit of force is kg m s^-2
// kappa here is kappa*a a non-dimensional number
double Fpp = -4.0/3.0*
Os_pressure*M_PI*(-3.0/4.0*pow(combinedSize,2.0)+3.0*dist*dist/16.0*radius_nm*radius_nm);
Fpp = -Bpp * Kappa * exp(-Kappa*(dist-2.0));
// Fpp += -9e-13 * exp(-kappa* (dist - 2.0));
F = Fpp*r/dist;
}
}
示例2: calForcesHelper
void Model_cell::calForcesHelper(int i, int j, Eigen::Vector3d &F, Eigen::Vector3d &inhib) {
double dist;
Eigen::Vector3d r;
dist = 0.0;
F.fill(0);
inhib.fill(0);
r = particles[j]->r - particles[i]->r;
dist = r.norm();
double Fpp;
if (dist < D0 && dist >= 1) {
Fpp = V_a * (dist - 1) / (D0 - 1);
F = Fpp * r / dist;
} else if (dist < 1) {
Fpp = -V_r * (1 - dist);
F = Fpp * r / dist;
}
if (dist < D0) {
inhib = -r / dist *exp(-(dist-1.0));
}
}