From 5a0d5a6560e337014f468a2d3e90d05de44d09f5 Mon Sep 17 00:00:00 2001 From: amartyads Date: Mon, 9 Dec 2024 15:15:59 +0100 Subject: [PATCH] docstyle, renamed function --- src/Simulation.cpp | 2 +- src/parallel/DomainDecompBase.cpp | 2 +- src/parallel/DomainDecompBase.h | 52 +++++++++++++++++++--- src/parallel/boundaries/BoundaryHandler.h | 2 +- src/parallel/boundaries/DimensionUtils.cpp | 2 +- 5 files changed, 50 insertions(+), 10 deletions(-) diff --git a/src/Simulation.cpp b/src/Simulation.cpp index 3dc1aa4c73..ebf61dc75b 100644 --- a/src/Simulation.cpp +++ b/src/Simulation.cpp @@ -450,7 +450,7 @@ void Simulation::readXML(XMLfileUnits& xmlconfig) { << " y - " << BoundaryUtils::convertBoundaryToString(yBoundary) << " z - " << BoundaryUtils::convertBoundaryToString(zBoundary) << std::endl; // go over all local boundaries, determine which are global - _domainDecomposition->setLocalBoundariesFromGlobal(_domain, _ensemble); + _domainDecomposition->setBoundsAndGlobalBoundaries(_domain, _ensemble); xmlconfig.changecurrentnode(".."); } diff --git a/src/parallel/DomainDecompBase.cpp b/src/parallel/DomainDecompBase.cpp index 2e92c301f7..7d8359f3bd 100644 --- a/src/parallel/DomainDecompBase.cpp +++ b/src/parallel/DomainDecompBase.cpp @@ -31,7 +31,7 @@ void DomainDecompBase::setGlobalBoundaryType(DimensionUtils::DimensionType dimen _boundaryHandler.setGlobalWallType(dimension, boundary); } -void DomainDecompBase::setLocalBoundariesFromGlobal(Domain* domain, Ensemble* ensemble) { +void DomainDecompBase::setBoundsAndGlobalBoundaries(Domain* domain, Ensemble* ensemble) { //find which walls to consider double startRegion[3], endRegion[3]; getBoundingBoxMinMax(domain, startRegion, endRegion); diff --git a/src/parallel/DomainDecompBase.h b/src/parallel/DomainDecompBase.h index b29ee19b1e..d526bfc0dc 100644 --- a/src/parallel/DomainDecompBase.h +++ b/src/parallel/DomainDecompBase.h @@ -290,21 +290,61 @@ class DomainDecompBase: public MemoryProfilable { virtual void printCommunicationPartners(std::string filename) const {}; - /* Set the global boundary type for the _boundaryHandler object. */ + /** + * @brief Set the global boundary type for the _boundaryHandler object. + * + * Defers directly to BoundaryHandler::setGlobalWallType(), check there for more documentation. + * + * @param dimension the dimension of interest, must be DimensionType enum member + * @param boundary the type of the boundary, must be BoundaryType enum member + */ void setGlobalBoundaryType(DimensionUtils::DimensionType dimension, BoundaryUtils::BoundaryType boundary); - /* Find which boundaries of a subdomain are actually global boundaries, and update _boundaryHandler. */ - void setLocalBoundariesFromGlobal(Domain* domain, Ensemble* ensemble); + /** + * @brief Sets up the _boundaryHandler object, updating the global and local domain bounds, and triggering + * BoundaryHandler::updateGlobalWallLookupTable() to refresh boundary conditions + * + * @param domain Domain object to get the local bounding boxes + * @param ensemble Ensemble object to get the global bounding boxes + */ + void setBoundsAndGlobalBoundaries(Domain* domain, Ensemble* ensemble); - /* Check if any of the global boundaries are invalid. */ + /** + * @brief Check if any of the global boundaries are invalid. + * + * Defers directly to BoundaryHandler::hasGlobalInvalidBoundary(), check there for more documentation. + * + * @return true if any of the 6 boundaries are invalid + * @return false if all 6 boundaries are valid + */ bool hasGlobalInvalidBoundary() const { return _boundaryHandler.hasGlobalInvalidBoundary();} + /** + * @brief Check if any of the global boundaries are non-periodic. + * + * If false, this is used to bypass all boundary-related code, to mimic default behaviour of ls1 + * (with all periodic boundaries). + * Defers directly to BoundaryHandler::hasGlobalNonPeriodicBoundary(), check there for more documentation. + * + * @return true if any of the 6 boundaries are non-periodic + * @return false if all 6 boundaries are periodic + */ bool hasGlobalNonPeriodicBoundary() const { return _boundaryHandler.hasGlobalNonPeriodicBoundary();} - /* Processes leaving particles according to the boundary coundition of the wall the particles would be leaving. */ + /** + * @brief Processes leaving particles according to the boundary coundition of the wall the particles would be leaving. + * + * Completely bypassed internally if ::hasGlobalNonPeriodicBoundary() is false + * Defers directly to BoundaryHandler::processGlobalWallLeavingParticles(), check there for more documentation. + */ void processBoundaryConditions(ParticleContainer* moleculeContainer, double timestepLength); - /* Delete all halo particles outside global boundas that are non-periodic. */ + /** + * @brief Delete all halo particles outside global boundas that are non-periodic. + * + * Completely bypassed internally if ::hasGlobalNonPeriodicBoundary() is false + * Defers directly to BoundaryHandler::removeNonPeriodicHalos(), check there for more documentation. + */ void removeNonPeriodicHalos(ParticleContainer* moleculeContainer); protected: diff --git a/src/parallel/boundaries/BoundaryHandler.h b/src/parallel/boundaries/BoundaryHandler.h index 08bcea4945..44d28e8506 100644 --- a/src/parallel/boundaries/BoundaryHandler.h +++ b/src/parallel/boundaries/BoundaryHandler.h @@ -54,7 +54,7 @@ class BoundaryHandler { * Since this returns the global wall type, every subdomain on every rank will return * the same value for the same input. * - * @param dimension tte dimension of interest, must be an ls1-style index (0 for x, 1 for y, 2 for z) + * @param dimension the dimension of interest, must be an ls1-style index (0 for x, 1 for y, 2 for z) * @return BoundaryUtils::BoundaryType enum member corresponding to the global wall type */ BoundaryUtils::BoundaryType getGlobalWallType(int dimension) const; diff --git a/src/parallel/boundaries/DimensionUtils.cpp b/src/parallel/boundaries/DimensionUtils.cpp index 4b8465e53b..5fd4994d0b 100644 --- a/src/parallel/boundaries/DimensionUtils.cpp +++ b/src/parallel/boundaries/DimensionUtils.cpp @@ -104,4 +104,4 @@ int DimensionUtils::convertDimensionToNumericAbs(DimensionType dimension) { int DimensionUtils::convertEnumToLS1DimIndex(DimensionType dimension) { return convertDimensionToNumericAbs(dimension) - 1; } -int DimensionUtils::findSign(DimensionType dimension) { return ::findSign(convertDimensionToNumeric(dimension)); } \ No newline at end of file +int DimensionUtils::findSign(DimensionType dimension) { return ::findSign(convertDimensionToNumeric(dimension)); }