Skip to content

Commit

Permalink
Fixed multi-instance behavior with matchstep option, formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophie Blondel committed Jan 13, 2025
1 parent 5d6964c commit f36302e
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 34 deletions.
3 changes: 1 addition & 2 deletions xolotl/core/include/xolotl/core/network/AlloyTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ toNameString(AlloySpecies species)
}

template <>
struct NumberOfSpecies<AlloySpecies> :
std::integral_constant<std::size_t, 6>
struct NumberOfSpecies<AlloySpecies> : std::integral_constant<std::size_t, 6>
{
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ namespace core
namespace network
{
template <typename TNetwork, typename TDerived>
KOKKOS_FUNCTION
double
KOKKOS_FUNCTION double
SinkReaction<TNetwork, TDerived>::computeRate(IndexType gridIndex, double time)
{
auto cl = this->_clusterData->getCluster(_reactant);
Expand Down
6 changes: 3 additions & 3 deletions xolotl/interface/src/Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ makeXolotlInterface(int& argc, const char* argv[])

// Get options
auto options = options::createOptions(argc, argv);
if (!options) {
return std::unique_ptr<IXolotlInterface>();
}
if (!options) {
return std::unique_ptr<IXolotlInterface>();
}
options->readParams(argc, argv);

// Create instance(s)
Expand Down
4 changes: 4 additions & 0 deletions xolotl/interface/src/MultiXolotl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ MultiXolotl::updateTemperaturesAndRates(
void
MultiXolotl::solveStep()
{
// Skip the first timestep because it doesn't do anything
if (currentTime() == 0.0)
return;

// Transfer the temperature to the full network
auto subInstanceData = getSubInstanceData();
// 0D
Expand Down
6 changes: 3 additions & 3 deletions xolotl/options/include/xolotl/options/CommandLineError.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace options
class CommandLineError : public std::runtime_error
{
public:
using std::runtime_error::runtime_error;
using std::runtime_error::runtime_error;
};
}
}
} // namespace options
} // namespace xolotl
10 changes: 5 additions & 5 deletions xolotl/util/include/xolotl/util/GrowthFactorStepSequence.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ class GrowthFactorStepSequence : public StepSequence
void
step() override;

double
startValue() const noexcept override
{
return _initialValue;
}
double
startValue() const noexcept override
{
return _initialValue;
}

double
at(std::size_t step) const override;
Expand Down
22 changes: 11 additions & 11 deletions xolotl/util/include/xolotl/util/TimeStepper.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ class TimeStepper
return _currentTime;
}

[[nodiscard]] double
startTime() const noexcept
{
return _startTime;
}

[[nodiscard]] double
startTimeStepSize() const noexcept
{
return _seq->startValue();
}
[[nodiscard]] double
startTime() const noexcept
{
return _startTime;
}

[[nodiscard]] double
startTimeStepSize() const noexcept
{
return _seq->startValue();
}

[[nodiscard]] double
previousTime() const noexcept
Expand Down
16 changes: 8 additions & 8 deletions xolotl/util/include/xolotl/util/TupleUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct TuplePushFrontHelper<T, std::tuple<Ts...>>
{
using Type = std::tuple<T, Ts...>;
};
}
} // namespace detail

template <typename TTuple, typename T>
using TuplePushFront = typename detail::TuplePushFrontHelper<T, TTuple>::Type;
Expand All @@ -29,15 +29,15 @@ struct TuplePopFrontHelper;
template <>
struct TuplePopFrontHelper<std::tuple<>>
{
using Type = std::tuple<>;
using Type = std::tuple<>;
};

template <typename T, typename... Ts>
struct TuplePopFrontHelper<std::tuple<T, Ts...>>
{
using Type = std::tuple<Ts...>;
};
}
} // namespace detail

template <typename TTuple>
using TuplePopFront = typename detail::TuplePopFrontHelper<TTuple>::Type;
Expand All @@ -52,7 +52,7 @@ struct TuplePushBackHelper<std::tuple<Ts...>, T>
{
using Type = std::tuple<Ts..., T>;
};
}
} // namespace detail

template <typename TTuple, typename T>
using TuplePushBack = typename detail::TuplePushBackHelper<TTuple, T>::Type;
Expand All @@ -65,7 +65,7 @@ struct TuplePopBackHelper;
template <>
struct TuplePopBackHelper<std::tuple<>>
{
using Type = std::tuple<>;
using Type = std::tuple<>;
};

template <typename T>
Expand All @@ -80,7 +80,7 @@ struct TuplePopBackHelper<std::tuple<T, Ts...>>
using Type =
TuplePushFront<typename TuplePopBackHelper<std::tuple<Ts...>>::Type, T>;
};
}
} // namespace detail

template <typename TTuple>
using TuplePopBack = typename detail::TuplePopBackHelper<TTuple>::Type;
Expand All @@ -102,7 +102,7 @@ struct TupleReverseHelper<std::tuple<T, Ts...>>
using Type =
TuplePushBack<typename TupleReverseHelper<std::tuple<Ts...>>::Type, T>;
};
}
} // namespace detail

template <typename TTuple>
using TupleReverse = typename detail::TupleReverseHelper<TTuple>::Type;
Expand All @@ -117,7 +117,7 @@ struct TupleApplyAllHelper<Tpl, std::tuple<Ts...>>
{
using Type = Tpl<Ts...>;
};
}
} // namespace detail

template <template <typename...> typename Tpl, typename TTuple>
using TupleApplyAll = typename detail::TupleApplyAllHelper<Tpl, TTuple>::Type;
Expand Down

0 comments on commit f36302e

Please sign in to comment.