Skip to content

Commit

Permalink
Addressed some issues in flux handlers and perf handler (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipFackler committed Feb 26, 2024
1 parent 9ec6c4e commit c32ffd1
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 52 deletions.
4 changes: 2 additions & 2 deletions xolotl/core/include/xolotl/core/flux/AlloyFitFluxHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class AlloyFitFluxHandler : public FluxHandler
*/
void
initializeFluxHandler(network::IReactionNetwork& network, int surfacePos,
std::vector<double> grid)
std::vector<double> grid) override
{
// Setup the ion damage and implantation depth profile
if (false) {
Expand Down Expand Up @@ -364,7 +364,7 @@ class AlloyFitFluxHandler : public FluxHandler
attenuation * ionDamageRate(i, xi - surfacePos));
});
}
}; // namespace flux
};
// end class AlloyFitFluxHandler

} // namespace flux
Expand Down
6 changes: 3 additions & 3 deletions xolotl/core/include/xolotl/core/flux/AlphaZrFitFluxHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class AlphaZrFitFluxHandler : public FluxHandler
*/
void
initializeFluxHandler(network::IReactionNetwork& network, int surfacePos,
std::vector<double> grid)
std::vector<double> grid) override
{
// Set the grid
xGrid = grid;
Expand Down Expand Up @@ -193,7 +193,7 @@ class AlphaZrFitFluxHandler : public FluxHandler
* \see IFluxHandler.h
*/
std::vector<std::pair<IdType, double>>
getImplantedFlux(std::vector<IdType> map)
getImplantedFlux(std::vector<IdType> map) override
{
std::vector<std::pair<IdType, double>> toReturn;
// Loop on the map
Expand All @@ -214,7 +214,7 @@ class AlphaZrFitFluxHandler : public FluxHandler
* \see IFluxHandler.h
*/
void
setImplantedFlux(std::vector<std::pair<IdType, double>> fluxVector)
setImplantedFlux(std::vector<std::pair<IdType, double>> fluxVector) override
{
fluxIndices.clear();
incidentFluxVec.clear();
Expand Down
4 changes: 2 additions & 2 deletions xolotl/core/include/xolotl/core/flux/CustomFitFluxHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class CustomFitFluxHandler : public FluxHandler
*/
void
initializeFluxHandler(network::IReactionNetwork& network, int surfacePos,
std::vector<double> grid)
std::vector<double> grid) override
{
// Clear everything
incidentFluxVec.clear();
Expand Down Expand Up @@ -381,7 +381,7 @@ class CustomFitFluxHandler : public FluxHandler
}

std::vector<double>
getInstantFlux(double time) const
getInstantFlux(double time) const override
{
// Create the vector to return
std::vector<double> toReturn;
Expand Down
2 changes: 1 addition & 1 deletion xolotl/core/include/xolotl/core/flux/FeFitFluxHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class FeFitFluxHandler : public FluxHandler
*/
void
initializeFluxHandler(network::IReactionNetwork& network, int surfacePos,
std::vector<double> grid)
std::vector<double> grid) override
{
// Only defined in 0D
if (xGrid.size() == 0) {
Expand Down
70 changes: 35 additions & 35 deletions xolotl/core/include/xolotl/core/flux/FluxHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ class FluxHandler : public IFluxHandler
/**
* \see IFluxHandler.h
*/
virtual void
void
initializeFluxHandler(network::IReactionNetwork& network, int surfacePos,
std::vector<double> grid);
std::vector<double> grid) override;

/**
* \see IFluxHandler.h
*/
virtual void
initializeTimeProfile(const std::string& fileName);
void
initializeTimeProfile(const std::string& fileName) override;

/**
* \see IFluxHandler.h
Expand All @@ -170,98 +170,98 @@ class FluxHandler : public IFluxHandler
/**
* \see IFluxHandler.h
*/
virtual void
incrementFluence(double dt);
void
incrementFluence(double dt) override;

/**
* \see IFluxHandler.h
*/
virtual void
computeFluence(double time);
void
computeFluence(double time) override;

/**
* \see IFluxHandler.h
*/
virtual void
setFluence(std::vector<double> fluence);
void
setFluence(std::vector<double> fluence) override;

/**
* \see IFluxHandler.h
*/
virtual std::vector<double>
getFluence() const;
std::vector<double>
getFluence() const override;

/**
* \see IFluxHandler.h
*/
virtual void
setFluxAmplitude(double flux);
void
setFluxAmplitude(double flux) override;

/**
* \see IFluxHandler.h
*/
virtual double
getFluxAmplitude() const;
double
getFluxAmplitude() const override;

/**
* \see IFluxHandler.h
*/
virtual double
getFluxRate() const;
double
getFluxRate() const override;

/**
* \see IFluxHandler.h
*/
virtual void
setPulseTime(double time)
void
setPulseTime(double time) override
{
return;
}

/**
* \see IFluxHandler.h
*/
virtual void
setProportion(double a)
void
setProportion(double a) override
{
return;
}

/**
* \see IFluxHandler.h
*/
virtual std::vector<std::pair<IdType, double>>
getImplantedFlux(std::vector<IdType> map)
std::vector<std::pair<IdType, double>>
getImplantedFlux(std::vector<IdType> map) override
{
return std::vector<std::pair<IdType, double>>();
}

/**
* \see IFluxHandler.h
*/
virtual std::vector<double>
getInstantFlux(double time) const;
void
setImplantedFlux(std::vector<std::pair<IdType, double>> fluxVector) override
{
return;
}

/**
* \see IFluxHandler.h
*/
virtual void
setImplantedFlux(std::vector<std::pair<IdType, double>> fluxVector)
{
return;
}
std::vector<double>
getInstantFlux(double time) const override;

/**
* \see IFluxHandler.h
*/
virtual std::vector<IdType>
getFluxIndices() const;
std::vector<IdType>
getFluxIndices() const override;

/**
* \see IFluxHandler.h
*/
virtual std::vector<double>
getReductionFactors() const;
std::vector<double>
getReductionFactors() const override;
};
// end class FluxHandler

Expand Down
2 changes: 1 addition & 1 deletion xolotl/core/include/xolotl/core/flux/FuelFitFluxHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class FuelFitFluxHandler : public FluxHandler
*/
void
initializeFluxHandler(network::IReactionNetwork& network, int surfacePos,
std::vector<double> grid)
std::vector<double> grid) override
{
// Set the grid
xGrid = grid;
Expand Down
2 changes: 1 addition & 1 deletion xolotl/core/include/xolotl/core/flux/PSIFluxHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class PSIFluxHandler : public FluxHandler
*/
void
initializeFluxHandler(network::IReactionNetwork& network, int surfacePos,
std::vector<double> grid)
std::vector<double> grid) override
{
// Call the general method
FluxHandler::initializeFluxHandler(network, surfacePos, grid);
Expand Down
6 changes: 3 additions & 3 deletions xolotl/core/include/xolotl/core/flux/PulsedFitFluxHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class PulsedFitFluxHandler : public FluxHandler
*/
void
initializeFluxHandler(network::IReactionNetwork& network, int surfacePos,
std::vector<double> grid)
std::vector<double> grid) override
{
// Call the general method
FluxHandler::initializeFluxHandler(network, surfacePos, grid);
Expand Down Expand Up @@ -143,7 +143,7 @@ class PulsedFitFluxHandler : public FluxHandler
* \see IFluxHandler.h
*/
void
setPulseTime(double time)
setPulseTime(double time) override
{
deltaTime = time;
return;
Expand All @@ -153,7 +153,7 @@ class PulsedFitFluxHandler : public FluxHandler
* \see IFluxHandler.h
*/
void
setProportion(double a)
setProportion(double a) override
{
alpha = a;
return;
Expand Down
7 changes: 3 additions & 4 deletions xolotl/perf/src/PerfHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,9 @@ PerfHandler::collectAllObjectNames(int myRank,
// Marshal all our object names.
auto myNamesBuf = std::make_unique<char[]>(nBytes);
char* pName = myNamesBuf.get();
for (auto nameIter = myNames.begin(); nameIter != myNames.end();
++nameIter) {
strcpy(pName, nameIter->c_str());
pName += (nameIter->length() + 1); // skip the NUL terminator
for (auto&& name : myNames) {
strncpy(pName, name.c_str(), name.length());
pName += (name.length() + 1); // skip the NUL terminator
}
assert(pName == (myNamesBuf.get() + nBytes));

Expand Down

0 comments on commit c32ffd1

Please sign in to comment.