本文整理汇总了C++中ChSharedPtr::Get_spe_funct方法的典型用法代码示例。如果您正苦于以下问题:C++ ChSharedPtr::Get_spe_funct方法的具体用法?C++ ChSharedPtr::Get_spe_funct怎么用?C++ ChSharedPtr::Get_spe_funct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChSharedPtr
的用法示例。
在下文中一共展示了ChSharedPtr::Get_spe_funct方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
// ChVector<>(
// 1 / 12.0 * anchor_mass * (1 * 1 + anchor_R * anchor_R),
// 1 / 12.0 * anchor_mass * (anchor_R * anchor_R + anchor_R * anchor_R),
// 1 / 12.0 * anchor_mass * (anchor_R * anchor_R + 1 * 1)));
//BLOCK = ChSharedBodyPtr(new ChBody(new ChCollisionModelParallel));
//InitObject(BLOCK, anchor_mass/2, Vector(0, 300, 0), Quaternion(1, 0, 0, 0), material, false, false, -20, -20);
//AddCollisionGeometry(BLOCK, BOX, ChVector<>(1, 1, 1), Vector(0, 0, 0), Quaternion(1, 0, 0, 0));
//FinalizeObject(BLOCK, (ChSystemParallel *) system_gpu);
//actuator_anchor = ChSharedPtr<ChLinkLockLock>(new ChLinkLockLock());
//actuator_anchor->Initialize(CONTAINER, BLOCK, ChCoordsys<>(ChVector<>(0, 0, 0), QUNIT));
//system_gpu->AddLink(actuator_anchor);
// apply motion
//motionFunc1 = new ChFunction_Ramp(0, -anchor_vel);
//actuator_anchor->SetMotion_Y(motionFunc1);
//actuator_anchor->SetMotion_axis(ChVector<>(0, 1, 0));
engine_anchor = ChSharedPtr<ChLinkEngine>(new ChLinkEngine);
engine_anchor->Initialize(CONTAINER, ANCHOR, ChCoordsys<>(ANCHOR->GetPos(), chrono::Q_from_AngAxis(CH_C_PI / 2, VECT_X)));
engine_anchor->Set_shaft_mode(ChLinkEngine::ENG_SHAFT_PRISM); // also works as revolute support
engine_anchor->Set_eng_mode(ChLinkEngine::ENG_MODE_SPEED);
system_gpu->AddLink(engine_anchor);
reference_engine = ChSharedPtr<ChLinkEngine>(new ChLinkEngine);
reference_engine->Initialize(CONTAINER, REFERENCE, ChCoordsys<>(REFERENCE->GetPos(), chrono::Q_from_AngAxis(CH_C_PI / 2, VECT_X)));
reference_engine->Set_shaft_mode(ChLinkEngine::ENG_SHAFT_PRISM); // also works as revolute support
reference_engine->Set_eng_mode(ChLinkEngine::ENG_MODE_SPEED);
system_gpu->AddLink(reference_engine);
if (ChFunction_Const* mfun = dynamic_cast<ChFunction_Const*>(engine_anchor->Get_spe_funct())) {
mfun->Set_yconst(anchor_rot * 1 / 60.0 * 2 * CH_C_PI); // rad/s angular speed
}
if (ChFunction_Const* mfun = dynamic_cast<ChFunction_Const*>(reference_engine->Get_spe_funct())) {
mfun->Set_yconst(anchor_rot * 1 / 60.0 * 2 * CH_C_PI); // rad/s angular speed
}
ReadAllObjectsWithGeometryChrono(system_gpu, "data/anchor/anchor.dat");
ChSharedPtr<ChMaterialSurface> material_read;
material_read = ChSharedPtr<ChMaterialSurface>(new ChMaterialSurface);
material_read->SetFriction(particle_slide_friction);
material_read->SetRollingFriction(particle_roll_friction);
material_read->SetSpinningFriction(particle_roll_friction);
material_read->SetCompliance(0);
material_read->SetCohesion(particle_cohesion * timestep);
for (int i = 0; i < system_gpu->Get_bodylist()->size(); i++) {
system_gpu->Get_bodylist()->at(i)->SetMaterialSurface(material_read);
}
} else {
layer_gen = new ParticleGenerator<ChSystemParallelDVI>((ChSystemParallelDVI *) system_gpu);
layer_gen->SetDensity(particle_density);
layer_gen->SetRadius(R3(particle_radius, particle_radius * .5, particle_radius));
layer_gen->SetNormalDistribution(particle_radius, particle_std_dev, 1);
layer_gen->material->SetFriction(particle_slide_friction);
layer_gen->material->SetCohesion(particle_cohesion);
layer_gen->material->SetRollingFriction(0);
layer_gen->material->SetSpinningFriction(0);
layer_gen->AddMixtureType(MIX_SPHERE);
}
//layer_gen->AddMixtureType(MIX_ELLIPSOID);