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);
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();
148 "sizes of names ("<<names.
size()<<
") and indices ("
149 << indices.
size()<<
") do not match \n";
153 auto len = names.
size();
167 if (diameterMassInertiaPropId(names[i], d,
m, I, pId))
169 diamVec.push_back(d);
170 massVec.push_back(
m);
172 pIdVec.push_back(pId);
173 IdVec.push_back(idHandler_.getNextId());
184 if(!diameter_.insertSetElement(indices, diamVec))
190 if(!mass_.insertSetElement(indices, massVec))
196 if(!I_.insertSetElement(indices, IVec))
202 if(!propertyId_.insertSetElement(indices, pIdVec))
208 if(!id_.insertSetElement(indices, IdVec))
226 control.settingsDict().getValOrSet(
228 word(
"AdamsBashforth3")
233 control.caseSetup().emplaceObjectOrGet<
sphereShape>(
251 static_cast<
real>(0.0000000001)
279 "Acceleration", &this->timers() ),
281 "Integration-predict", &this->timers() ),
283 "Integration-correct", &this->timers() )
288 <<
" for rotational velocity."<<
endREPORT;
300 " error in creating integration object for rVelocity. \n";
307 auto [minInd, maxInd] =
pStruct().activeRange();
310 auto n = indexHD.
size();
316 for(
auto i=0; i<
n; i++)
318 rvel.push_back( hrVel[index(i)]);
321 REPORT(2)<<
"Initializing the required vectors for rotational velocity integratoin\n "<<
endREPORT;
337 if(rVelIntegration_->needSetInitialVals())
341 auto indexHD =
pStruct().insertedPointIndex();
343 auto n = indexHD.size();
344 auto index = indexHD.indicesHost();
347 const auto hrVel = rVelocity_.hostVector();
349 for(
auto i=0; i<
n; i++)
351 rvel.push_back( hrVel[index(i)]);
354 rVelIntegration_->setInitialVals(indexHD, rvel);
369 if( position.
size() != shapes.
size() )
372 " size of vectors position ("<<position.
size()<<
373 ") and shapes ("<<shapes.
size()<<
") are not the same. \n";
377 auto exclusionListAllPtr = getFieldObjectList();
379 auto newInsertedPtr =
pStruct().insertPoints( position, setField, time(), exclusionListAllPtr());
384 " error in inserting points into pStruct. \n";
388 auto& newInserted = newInsertedPtr();
390 if(!shapeName_.insertSetElement(newInserted, shapes))
393 " error in inserting shapes into sphereParticles system.\n";
397 if( !insertSphereParticles(shapes, newInserted) )
400 "error in inserting shapes into the sphereParticles. \n";
405 auto activeR = this->activeRange();
407 REPORT(1)<<
"Active range is "<<
yellowText(
"["<<activeR.first<<
", "<<activeR.second<<
")")<<
408 " and number of active points is "<<
cyanText(this->numActive())<<