/*------------------------------- phasicFlow --------------------------------- O C enter of O O E ngineering and O O M ultiscale modeling of OOOOOOO F luid flow ------------------------------------------------------------------------------ Copyright (C): www.cemf.ir email: hamid.r.norouzi AT gmail.com ------------------------------------------------------------------------------ Licence: This file is part of phasicFlow code. It is a free software for simulating granular and multiphase flows. You can redistribute it and/or modify it under the terms of GNU General Public License v3 or any other later versions. phasicFlow is distributed to help others in their research in the field of granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -----------------------------------------------------------------------------*/ #include "sphereParticles.hpp" #include "systemControl.hpp" #include "vocabs.hpp" //#include "setFieldList.hpp" //#include "sphereParticlesKernels.hpp" /*pFlow::uniquePtr> pFlow::sphereParticles::getFieldObjectList()const { auto objListPtr = particles::getFieldObjectList(); objListPtr().push_back( static_cast(&I_) ); return objListPtr; } bool pFlow::sphereParticles::diameterMassInertiaPropId ( const word& shName, real& diam, real& mass, real& I, int8& propIdx ) { uint32 idx; if( !shapes_.nameToIndex(shName, idx) ) { printKeys(fatalErrorInFunction<< " wrong shape name in the input: "<< shName<(pIdx); return true; } bool pFlow::sphereParticles::initializeParticles() { int32IndexContainer indices( 0, static_cast(shapeName_.size())); return insertSphereParticles(shapeName_, indices, false); }*/ /*bool pFlow::sphereParticles::beforeIteration() { particles::beforeIteration(); intPredictTimer_.start(); //INFO<<"before dyn predict"<dt(), accelertion_); //INFO<<"after dyn predict"<dt(),rVelocity_, rAcceleration_); //INFO<<"after rvel predict"<>; auto aPointsMask = dynPointStruct().activePointsMaskDevice(); auto aRange = aPointsMask.activeRange(); auto field_I = I_.fieldDevice(); auto field_shapeIndex = shapeIndex().fieldDevice(); const auto& shp = getShapes(); realVector_D I ("I", shp.Inertia()); auto d_I = I.deviceVector(); Kokkos::parallel_for( "particles::initInertia", policy(aRange.start(), aRange.end()), LAMBDA_HD(uint32 i) { if(aPointsMask(i)) { uint32 index = field_shapeIndex[i]; field_I[i] = d_I[index]; } }); Kokkos::fence(); return true; } pFlow::sphereParticles::sphereParticles( systemControl &control, const property& prop ) : particles(control), spheres_ ( shapeFile__, &control.caseSetup(), prop ), I_ ( objectFile ( "I", "", objectFile::READ_NEVER, objectFile::WRITE_NEVER ), dynPointStruct(), static_cast(0.0000000001) ), rVelocity_ ( objectFile ( "rVelocity", "", objectFile::READ_IF_PRESENT, objectFile::WRITE_ALWAYS ), dynPointStruct(), zero3 ), rAcceleration_ ( objectFile( "rAcceleration", "", objectFile::READ_IF_PRESENT, objectFile::WRITE_ALWAYS ), dynPointStruct(), zero3 ), accelerationTimer_( "Acceleration", &this->timers() ), intPredictTimer_( "Integration-predict", &this->timers() ), intCorrectTimer_( "Integration-correct", &this->timers() ) { auto intMethod = control.settingsDict().getVal("integrationMethod"); REPORT(1)<<"Creating integration method "<needSetInitialVals()) { auto [minInd, maxInd] = pStruct().activeRange(); int32IndexContainer indexHD(minInd, maxInd); auto n = indexHD.size(); auto index = indexHD.indicesHost(); realx3Vector rvel(n,RESERVE()); const auto hrVel = rVelocity_.hostVector(); for(auto i=0; isetInitialVals(indexHD, rvel); }*/ if(!initInertia()) { fatalExit; } } /*bool pFlow::sphereParticles::update(const eventMessage& msg) { if(rVelIntegration_->needSetInitialVals()) { auto indexHD = pStruct().insertedPointIndex(); auto n = indexHD.size(); auto index = indexHD.indicesHost(); realx3Vector rvel(n,RESERVE()); const auto hrVel = rVelocity_.hostVector(); for(auto i=0; isetInitialVals(indexHD, rvel); } return true; }*/ /*bool pFlow::sphereParticles::insertParticles ( const realx3Vector& position, const wordVector& shapes, const setFieldList& setField ) { if( position.size() != shapes.size() ) { fatalErrorInFunction<< " size of vectors position ("<activeRange(); REPORT(1)<< "Active range is "<numActive())<< " and pointStructure capacity is "<capacity())<