Skip to content

Commit

Permalink
docstyle, renamed function
Browse files Browse the repository at this point in the history
  • Loading branch information
amartyads committed Dec 9, 2024
1 parent 26df610 commit 5a0d5a6
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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("..");
}

Expand Down
2 changes: 1 addition & 1 deletion src/parallel/DomainDecompBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
52 changes: 46 additions & 6 deletions src/parallel/DomainDecompBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/parallel/boundaries/BoundaryHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/parallel/boundaries/DimensionUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)); }
int DimensionUtils::findSign(DimensionType dimension) { return ::findSign(convertDimensionToNumeric(dimension)); }

0 comments on commit 5a0d5a6

Please sign in to comment.