|
| 1 | +#include "processorAB2BoundaryIntegration.hpp" |
| 2 | +#include "AdamsBashforth2.hpp" |
| 3 | +#include "AB2Kernels.hpp" |
| 4 | +#include "boundaryConfigs.hpp" |
| 5 | + |
| 6 | +pFlow::processorAB2BoundaryIntegration::processorAB2BoundaryIntegration( |
| 7 | + const boundaryBase &boundary, |
| 8 | + const pointStructure &pStruct, |
| 9 | + const word &method, |
| 10 | + integration& intgrtn |
| 11 | +) |
| 12 | +: |
| 13 | + boundaryIntegration(boundary, pStruct, method, intgrtn) |
| 14 | +{} |
| 15 | + |
| 16 | +bool pFlow::processorAB2BoundaryIntegration::correct( |
| 17 | + real dt, |
| 18 | + const realx3PointField_D& y, |
| 19 | + const realx3PointField_D& dy |
| 20 | +) |
| 21 | +{ |
| 22 | + |
| 23 | +#ifndef BoundaryModel1 |
| 24 | + if(this->isBoundaryMaster()) |
| 25 | + { |
| 26 | + const uint32 thisIndex = thisBoundaryIndex(); |
| 27 | + const auto& AB2 = static_cast<const AdamsBashforth2&>(Integration()); |
| 28 | + const auto& dy1View = AB2.BoundaryField(thisIndex).neighborProcField().deviceView(); |
| 29 | + const auto& dyView = dy.BoundaryField(thisIndex).neighborProcField().deviceView(); |
| 30 | + const auto& yView = y.BoundaryField(thisIndex).neighborProcField().deviceView(); |
| 31 | + const rangeU32 aRange(0u, dy1View.size()); |
| 32 | + return AB2Kernels::intAllActive( |
| 33 | + "AB2Integration::correct."+this->boundaryName(), |
| 34 | + dt, |
| 35 | + aRange, |
| 36 | + yView, |
| 37 | + dyView, |
| 38 | + dy1View |
| 39 | + ); |
| 40 | + } |
| 41 | +#endif //BoundaryModel1 |
| 42 | + |
| 43 | + |
| 44 | + return true; |
| 45 | +} |
| 46 | + |
| 47 | +bool pFlow::processorAB2BoundaryIntegration::correctPStruct(real dt, const realx3PointField_D &vel) |
| 48 | +{ |
| 49 | + |
| 50 | + #ifndef BoundaryModel1 |
| 51 | + if(this->isBoundaryMaster()) |
| 52 | + { |
| 53 | + const uint32 thisIndex = thisBoundaryIndex(); |
| 54 | + const auto& AB2 = static_cast<const AdamsBashforth2&>(Integration()); |
| 55 | + const auto& dy1View = AB2.BoundaryField(thisIndex).neighborProcField().deviceView(); |
| 56 | + const auto& velView = vel.BoundaryField(thisIndex).neighborProcField().deviceView(); |
| 57 | + const auto& xposView = boundary().neighborProcPoints().deviceView(); |
| 58 | + const rangeU32 aRange(0u, dy1View.size()); |
| 59 | + return AB2Kernels::intAllActive( |
| 60 | + "AB2Integration::correctPStruct."+this->boundaryName(), |
| 61 | + dt, |
| 62 | + aRange, |
| 63 | + xposView, |
| 64 | + velView, |
| 65 | + dy1View |
| 66 | + ); |
| 67 | + } |
| 68 | +#endif //BoundaryModel1 |
| 69 | + |
| 70 | + return true; |
| 71 | +} |
0 commit comments