|
Peano
|
Functions | |
| template<typename Particle > | |
| void | applyFixedBoundaryCondition (Particle &particle, const peano4::datamanagement::VertexMarker &marker, const tarch::la::Vector< Dimensions, double > &domainOffset, const tarch::la::Vector< Dimensions, double > &domainSize, double relativeDomainHalo, int treeId) |
| Apply fixed boundary conditions to particle. | |
| std::pair< tarch::la::Vector< Dimensions, double >, tarch::la::Vector< Dimensions, double > > | getUpdateDueToFixedBoundaryCondition (const tarch::la::Vector< Dimensions, double > &particleX, const tarch::la::Vector< Dimensions, double > &particleV, double maxV, double maxDt, double h, const tarch::la::Vector< Dimensions, double > &domainOffset, const tarch::la::Vector< Dimensions, double > &domainSize, double relativeDomainHalo) |
| Determine updated position and velocity due to boundary conditions. | |
| bool | isVertexOnGlobalBoundary (const peano4::datamanagement::VertexMarker &marker, const tarch::la::Vector< Dimensions, double > &domainOffset, const tarch::la::Vector< Dimensions, double > &domainSize) |
| void swift2::boundaryconditions::applyFixedBoundaryCondition | ( | Particle & | particle, |
| const peano4::datamanagement::VertexMarker & | marker, | ||
| const tarch::la::Vector< Dimensions, double > & | domainOffset, | ||
| const tarch::la::Vector< Dimensions, double > & | domainSize, | ||
| double | relativeDomainHalo, | ||
| int | treeId ) |
Apply fixed boundary conditions to particle.
This routine is usually inserted into your code by the action set swift2.api.boundaryconditions.Fixed. It serves as a proxy to the other applyFixedBoundaryCondition(), i.e. forwards the actual position update computation to this routine, and then takes the updated position, writes it into the particle, and logs the position update within the particle database (so all assertions are still correct).
| std::pair< tarch::la::Vector< Dimensions, double >, tarch::la::Vector< Dimensions, double > > swift2::boundaryconditions::getUpdateDueToFixedBoundaryCondition | ( | const tarch::la::Vector< Dimensions, double > & | particleX, |
| const tarch::la::Vector< Dimensions, double > & | particleV, | ||
| double | maxV, | ||
| double | maxDt, | ||
| double | h, | ||
| const tarch::la::Vector< Dimensions, double > & | domainOffset, | ||
| const tarch::la::Vector< Dimensions, double > & | domainSize, | ||
| double | relativeDomainHalo ) |
Determine updated position and velocity due to boundary conditions.
See applyFixedBoundaryCondition() and notably swift2.api.boundaryconditions.Fixed for some context where this routine is used. Please study notably the generic boundary condition discussion of the project. It provides code snippets how to use this routine.
Our boundary condition handling consists of a series of checks:
Close in the last sentence means that they are within a fraction of relativeDomainHalo of the current particle's mesh size. The damping factor is subject to a linear interpolation, i.e. if a particle sits directly on the boundary and moves outside, we damp its velocity by 0. We set the velocity of 0. If it is relativeDomainHalo of the mesh size away from the boundary and approaches it, we multiply this velocity by 1, i.e. we do not damp it. If it is halfway close to the boundary, we multiply the velocity with 0.5 and therefore damp the approach velocity of the particle.
| relativeDomainHalo | Floating point value between zero and one. If you set it to zero, you disable the velocity damping. |
| bool swift2::boundaryconditions::isVertexOnGlobalBoundary | ( | const peano4::datamanagement::VertexMarker & | marker, |
| const tarch::la::Vector< Dimensions, double > & | domainOffset, | ||
| const tarch::la::Vector< Dimensions, double > & | domainSize ) |