/*------------------------------- 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. -----------------------------------------------------------------------------*/ template bool pFlow::InsertionRegion::checkForContact ( const realx3Vector& pos, const realVector& diams, const realx3& p, const real& d ) { ForAll(i, pos) { if( length(pos[i]-p) < 0.5*(diams[i]+d) ) return true; } return false; } template pFlow::InsertionRegion::InsertionRegion ( const word& name, const insertion& instn, const ShapeType& shapes ) : insertionRegion(name, instn), shapes_(shapes) {} template bool pFlow::InsertionRegion::insertParticles ( uint32 iter, real t, real dt, wordVector& names, realx3Vector& pos, bool& insertionOccured ) { insertionOccured = false; if(!insertionTime(iter, t, dt)) return true; uint32 newNum = numberToBeInserted(iter, t, dt); if(newNum == 0) return true; names.reserve(max(newNum,names.capacity())); pos.reserve(max(newNum,pos.capacity())); names.clear(); pos.clear(); realVector diams("diams", newNum, 0, RESERVE()); for(uint32 i=0; i