<commit_before>#pragma once

#include "blitz_typedefs.hpp"
#include "constants.hpp"
#include "error.hpp"
#include "global_config.hpp"

namespace mocc {
    
    typedef std::array<int, 3> BC_Size_t;
    typedef std::array<Boundary, 6> BC_Type_t;

    /**
     * This defines a general boundary condition container, which can store an
     * angular flux condition as a 1-dimensional collection of values for
     * each dimension-normal, angle, and energy. It is the responsibility of the
     * sweeper itself to determine what the indices of the actual conditions
     * mean.
     */
    class BoundaryCondition {
    public:
        /**
         * \brief Construct a simple boundary condition, where there are the
         * same number of conditions per face/angle (Sn case).
         *
         * \param n_group the number of groups
         * \param n_angle the number of angles
         * \param n_bc the number of conditions to store for each direction
         * normal.
         *
         * To cut down on code duplication, just expand the scalar \p n_bc into
         * a vector and call the general case (below).
         */
        BoundaryCondition( int n_group, const AngularQuadrature &angquad,
                BC_Type_t bc, BC_Size_t n_bc ):
            BoundaryCondition( n_group,
                               angquad,
                               bc,
                               std::vector<BC_Size_t>(angquad.ndir(), n_bc) )
        {
            return;
        }

        /**
         * \brief Construct a more complicated boundary condition, where each
         * angle can have a different number of conditions (MoC case).
         *
         * \param n_group the number of energy groups
         * \param n_ang the number of angles
         * \param n_bc a vector containing the number of BCs needed for each
         * angle.
         */
        BoundaryCondition( int n_group, const AngularQuadrature &angquad, 
                BC_Type_t bc, std::vector< BC_Size_t > n_bc ):
            n_group_(n_group),
            n_angle_(n_bc.size()),
            bc_(bc),
            size_(n_bc),
            ang_quad_(angquad)
        {
            assert( (angquad.ndir()   == (int)n_bc.size()) || 
                    (angquad.ndir()/2 == (int)n_bc.size()) );

            int n_angle = n_bc.size();

            bc_per_group_ = 0;
            for( auto n: n_bc ) {
                bc_per_group_ += n[0] + n[1] + n[2];
            }

            size_t total_size = bc_per_group_*n_group;
            data_.resize(total_size);
            offset_.resize(n_angle, 3);
            assert(offset_( 0, blitz::Range::all() ).isStorageContiguous());

            int offset = 0;<commit_msg>Fix documentation<commit_after>#pragma once

#include "blitz_typedefs.hpp"
#include "constants.hpp"
#include "error.hpp"
#include "global_config.hpp"

namespace mocc {
    
    typedef std::array<int, 3> BC_Size_t;
    typedef std::array<Boundary, 6> BC_Type_t;

    /**
     * This defines a general boundary condition container, which can store an
     * angular flux condition as a 1-dimensional collection of values for
     * each dimension-normal, angle, and energy. It is the responsibility of the
     * sweeper itself to determine what the indices of the actual conditions
     * mean.
     */
    class BoundaryCondition {
    public:
        /**
         * \brief Construct a simple boundary condition, where there are the
         * same number of conditions per face/angle (Sn case).
         *
         * \param n_group the number of groups
         * \param angquad the \ref AngularQuadrature to use for reflections and
         * such
         * \param bc the \ref Boundary condition to enforce at each domain
         * boundary
         * \param n_bc the number of conditions to store for each direction
         * normal.
         *
         * To cut down on code duplication, just expand the scalar \p n_bc into
         * a vector and call the general case (below).
         */
        BoundaryCondition( int n_group, const AngularQuadrature &angquad,
                BC_Type_t bc, BC_Size_t n_bc ):
            BoundaryCondition( n_group,
                               angquad,
                               bc,
                               std::vector<BC_Size_t>(angquad.ndir(), n_bc) )
        {
            return;
        }

        /**
         * \brief Construct a more complicated boundary condition, where each
         * angle can have a different number of conditions (MoC case).
         *
         * \param n_group the number of groups
         * \param angquad the \ref AngularQuadrature to use for reflections and
         * such
         * \param bc the \ref Boundary condition to enforce at each domain
         * boundary
         * \param n_bc a vector containing the number of BCs needed for each
         * angle.
         */
        BoundaryCondition( int n_group, const AngularQuadrature &angquad, 
                BC_Type_t bc, std::vector< BC_Size_t > n_bc ):
            n_group_(n_group),
            n_angle_(n_bc.size()),
            bc_(bc),
            size_(n_bc),
            ang_quad_(angquad)
        {
            assert( (angquad.ndir()   == (int)n_bc.size()) || 
                    (angquad.ndir()/2 == (int)n_bc.size()) );

            int n_angle = n_bc.size();

            bc_per_group_ = 0;
            for( auto n: n_bc ) {
                bc_per_group_ += n[0] + n[1] + n[2];
            }

            size_t total_size = bc_per_group_*n_group;
            data_.resize(total_size);
            offset_.resize(n_angle, 3);
            assert(offset_( 0, blitz::Range::all() ).isStorageContiguous());

            int offset = 0;
{'fraction_non_alphanumeric': 0.08576929809207072, 'fraction_numerical': 0.0038508664449501137, 'mean_word_length': 1.7510832932113625, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2207733', 'n_tokens_mistral': 1627, 'n_tokens_neox': 1563, 'n_words': 511}