30 objListPtr().push_back(
46 if( !shapes_.nameToIndex(shName, idx) )
49 " wrong shape name in the input: "<< shName<<
endl<<
50 " available shape names are: ", shapes_.names())<<
endl;
54 diam = shapes_.diameter(idx);
55 word materialName = shapes_.material(idx);
57 if( !property_.nameToIndex(materialName, pIdx) )
60 " wrong material name "<< materialName <<
" specified for shape "<< shName<<
61 " in the sphereShape dictionary.\n"<<
62 " available materials are "<< property_.materials()<<
endl;
65 real rho = property_.density(pIdx);
67 mass =
Pi/6.0*
pow(diam,3.0)*rho;
68 I = 0.4 * mass *
pow(diam/2.0,2.0);
69 propIdx=
static_cast<int8>(pIdx);
78 static_cast<int32>(shapeName_.size()));
80 return insertSphereParticles(shapeName_, indices,
false);
88 intPredictTimer_.start();
91 dynPointStruct_.predict(this->dt(), accelertion_);
95 rVelIntegration_().predict(this->dt(),rVelocity_, rAcceleration_);
98 intPredictTimer_.end();
107 accelerationTimer_.start();
111 mass().deviceVectorAll(),
112 contactForce().deviceVectorAll(),
113 I().deviceVectorAll(),
114 contactTorque().deviceVectorAll(),
116 accelertion().deviceVectorAll(),
117 rAcceleration().deviceVectorAll()
119 accelerationTimer_.end();
121 intCorrectTimer_.start();
123 dynPointStruct_.correct(this->dt(), accelertion_);
125 rVelIntegration_().correct(this->dt(), rVelocity_, rAcceleration_);
127 intCorrectTimer_.end();
149 "sizes of names ("<<names.
size()<<
") and indices ("
150 << indices.
size()<<
") do not match \n";
154 auto len = names.
size();
168 if (diameterMassInertiaPropId(names[i], d,
m, I, pId))
170 diamVec.push_back(d);
171 massVec.push_back(
m);
173 pIdVec.push_back(pId);
174 if(setId) IdVec.push_back(idHandler_.getNextId());
186 if(!diameter_.insertSetElement(indices, diamVec))
192 if(!mass_.insertSetElement(indices, massVec))
198 if(!I_.insertSetElement(indices, IVec))
204 if(!propertyId_.insertSetElement(indices, pIdVec))
212 if( !id_.insertSetElement(indices, IdVec))
232 control.settingsDict().getValOrSet(
234 word(
"AdamsBashforth3")
239 control.caseSetup().emplaceObjectOrGet<
sphereShape>(
257 static_cast<
real>(0.0000000001)
285 "Acceleration", &this->timers() ),
287 "Integration-predict", &this->timers() ),
289 "Integration-correct", &this->timers() )
294 <<
" for rotational velocity."<<
endREPORT;
306 " error in creating integration object for rVelocity. \n";
313 auto [minInd, maxInd] =
pStruct().activeRange();
316 auto n = indexHD.
size();
322 for(
auto i=0; i<
n; i++)
324 rvel.push_back( hrVel[index(i)]);
327 REPORT(2)<<
"Initializing the required vectors for rotational velocity integratoin\n "<<
endREPORT;
343 if(rVelIntegration_->needSetInitialVals())
347 auto indexHD =
pStruct().insertedPointIndex();
349 auto n = indexHD.size();
350 auto index = indexHD.indicesHost();
353 const auto hrVel = rVelocity_.hostVector();
355 for(
auto i=0; i<
n; i++)
357 rvel.push_back( hrVel[index(i)]);
360 rVelIntegration_->setInitialVals(indexHD, rvel);
375 if( position.
size() != shapes.
size() )
378 " size of vectors position ("<<position.
size()<<
379 ") and shapes ("<<shapes.
size()<<
") are not the same. \n";
383 auto exclusionListAllPtr = getFieldObjectList();
385 auto newInsertedPtr =
pStruct().insertPoints( position, setField, time(), exclusionListAllPtr());
390 " error in inserting points into pStruct. \n";
394 auto& newInserted = newInsertedPtr();
396 if(!shapeName_.insertSetElement(newInserted, shapes))
399 " error in inserting shapes into sphereParticles system.\n";
403 if( !insertSphereParticles(shapes, newInserted) )
406 "error in inserting shapes into the sphereParticles. \n";
411 auto activeR = this->activeRange();
413 REPORT(1)<<
"Active range is "<<
yellowText(
"["<<activeR.first<<
", "<<activeR.second<<
")")<<
414 " and number of active points is "<<
cyanText(this->numActive())<<