Add doxygen comments where needed

This commit is contained in:
Paul Romano 2018-08-23 21:38:23 -05:00
parent c3b7ebd40c
commit 83d64397d1
8 changed files with 67 additions and 14 deletions

View file

@ -37,6 +37,7 @@ public:
//! \return Sampled value
double sample() const;
// Properties
const std::vector<double>& x() const { return x_; }
const std::vector<double>& p() const { return p_; }
private:

View file

@ -48,6 +48,8 @@ public:
//! Sample a position from the distribution
//! \return Sampled position
Position sample() const;
// Properties
bool only_fissionable() const { return only_fissionable_; }
private:
Position lower_left_; //!< Lower-left coordinates of box

View file

@ -6,12 +6,15 @@
namespace openmc {
//! Determine if a file exists
//! \param[in] filename Path to file
//! \return Whether file exists
inline bool file_exists(const std::string& filename)
{
std::ifstream s {filename};
return s.good();
}
}
} // namespace openmc
#endif // OPENMC_FILE_UTILS_H
#endif // OPENMC_FILE_UTILS_H

View file

@ -1,3 +1,6 @@
//! \file nuclide.h
//! \brief Nuclide type and other associated types/data
#ifndef OPENMC_NUCLIDE_H
#define OPENMC_NUCLIDE_H
@ -7,6 +10,12 @@
namespace openmc {
//==============================================================================
// Global variables
//==============================================================================
// Minimum/maximum transport energy for each particle type. Order corresponds to
// that of the ParticleType enum
extern std::array<double, 2> energy_min;
extern std::array<double, 2> energy_max;

View file

@ -1,3 +1,6 @@
//! \file simulation.h
//! \brief Variables/functions related to a running simulation
#ifndef OPENMC_SIMULATION_H
#define OPENMC_SIMULATION_H
@ -6,6 +9,10 @@
namespace openmc {
//==============================================================================
// Global variables
//==============================================================================
extern "C" int openmc_current_batch;
extern "C" int openmc_current_gen;
extern "C" int64_t openmc_current_work;
@ -16,7 +23,14 @@ extern std::vector<int64_t> work_index;
#pragma omp threadprivate(openmc_current_work)
//==============================================================================
// Functions
//==============================================================================
//! Initialize simulation
extern "C" void openmc_simulation_init_c();
//! Determine number of particles to transport per process
void calculate_work();
} // namespace openmc

View file

@ -1,3 +1,6 @@
//! \file source.h
//! \brief External source distributions
#ifndef OPENMC_SOURCE_H
#define OPENMC_SOURCE_H
@ -19,17 +22,22 @@ namespace openmc {
class SourceDistribution {
public:
// Constructors
SourceDistribution(UPtrSpace space, UPtrAngle angle, UPtrDist energy);
explicit SourceDistribution(pugi::xml_node node);
//! Sample from the external source distribution
//! \return Sampled site
Bank sample() const;
// Properties
double strength() const { return strength_; }
private:
ParticleType particle_ {ParticleType::neutron};
double strength_ {1.0};
UPtrSpace space_;
UPtrAngle angle_;
UPtrDist energy_;
ParticleType particle_ {ParticleType::neutron}; //!< Type of particle emitted
double strength_ {1.0}; //!< Source strength
UPtrSpace space_; //!< Spatial distribution
UPtrAngle angle_; //!< Angular distribution
UPtrDist energy_; //!< Energy distribution
};
//==============================================================================
@ -47,6 +55,7 @@ extern "C" void initialize_source();
//! Sample a site from all external source distributions in proportion to their
//! source strength
//! \return Sampled source site
extern "C" Bank sample_external_source();
} // namespace openmc

View file

@ -2,10 +2,17 @@
namespace openmc {
// Order corresponds to ParticleType enum
//==============================================================================
// Global variables
//==============================================================================
std::array<double, 2> energy_min {0.0, 0.0};
std::array<double, 2> energy_max {INFTY, INFTY};
//==============================================================================
// Fortran compatibility functions
//==============================================================================
extern "C" void
set_particle_energy_bounds(int particle, double E_min, double E_max)
{

View file

@ -22,8 +22,22 @@ int openmc_run() {
namespace openmc {
//==============================================================================
// Global variables
//==============================================================================
std::vector<int64_t> work_index;
//==============================================================================
// Functions
//==============================================================================
void openmc_simulation_init_c()
{
// Determine how much work each process should do
calculate_work();
}
void calculate_work()
{
// Determine minimum amount of particles to simulate on each processor
@ -48,10 +62,4 @@ void calculate_work()
}
}
void openmc_simulation_init_c()
{
// Determine how much work each process should do
calculate_work();
}
} // namespace openmc