<commit_before>#include <iostream>
#include <exception>

#include "global_config.hpp"
#include "files.hpp"
#include "input_proc.hpp"
#include "core_mesh.hpp"
#include "error.hpp"
#include "h5file.hpp"
#include "transport_sweeper.hpp"


using std::cout;
using std::cin;
using std::endl;

using namespace mocc;

int main(int argc, char* argv[]){
	cout << "Ahoy!" << endl;
	cout << "cmd: " << argv[0] << endl;
	
	// Make sure we have an input file
	if(argc < 2){
		Error("No input file specified!");
	}
	
	// Spin up the log file. For now, just use the name of the input file.
	StartLogFile(argv[1]);
	
	LogFile << "Welcome to " << PROG_NAME << "!" << std::endl << std::endl;

	// Parse the input file
	InputProc inProc(argv[1]);

    // Pull a shared pointer to the top-level solver and make it go
    SP_Solver_t solver = inProc.solver();
    solver->solve();

    // Output stuff
    const TransportSweeper* sweeper_p = solver->sweeper();

    VecF flux;
    sweeper_p->get_pin_flux(0, flux);
    
    H5File outfile("out.h5");

    outfile.write("foo", flux, VecI {6, 9});

    StopLogFile();
}<commit_msg>Add more output to the HDF5 file<commit_after>#include <iostream>
#include <iomanip>
#include <exception>
#include <sstream>

#include "global_config.hpp"
#include "files.hpp"
#include "input_proc.hpp"
#include "core_mesh.hpp"
#include "error.hpp"
#include "h5file.hpp"
#include "transport_sweeper.hpp"


using std::cout;
using std::cin;
using std::endl;

using namespace mocc;

// The global top-level solver
SP_Solver_t solver;

// Global core mesh
SP_CoreMesh_t mesh;

void output();

int main(int argc, char* argv[]){
	// Make sure we have an input file
	if(argc < 2){
		Error("No input file specified!");
	}
	
	// Spin up the log file. For now, just use the name of the input file.
	StartLogFile(argv[1]);
	
	LogFile << "Welcome to " << PROG_NAME << "!" << std::endl << std::endl;

	// Parse the input file
	InputProc inProc(argv[1]);

    // Get an SP to the core mesh
    mesh = inProc.core_mesh();

    // Pull a shared pointer to the top-level solver and make it go
    solver = inProc.solver();
    solver->solve();

    // Output stuff
    output();

    StopLogFile();
}

void output(){
    const TransportSweeper* sweeper_p = solver->sweeper();

    // Get core dimensions from the mesh
    const int nx = mesh->nx();
    const int ny = mesh->ny();
    const int nz = mesh->nz();
    VecI dims;
    dims.push_back(nz);
    dims.push_back(ny);
    dims.push_back(nx);

    H5File outfile("out.h5");



    // Make a group in the file to store the flux
    outfile.mkdir("/flux");

    // Provide energy group upper bounds
    VecF eubounds = sweeper_p->eubounds();
    outfile.write("/eubounds", eubounds, VecI(1, eubounds.size()));
    outfile.write("/ng", eubounds.size());

    for( int ig=0; ig<sweeper_p->n_grp(); ig++ ) {
        VecF flux;
        sweeper_p->get_pin_flux(ig, flux);


        std::stringstream setname;
        setname << "/flux/" << std::setfill('0') << std::setw(3) << ig+1;

        outfile.write(setname.str(), flux, dims);
    }
    
}
{'fraction_non_alphanumeric': 0.15342199156665584, 'fraction_numerical': 0.007135906584495621, 'mean_word_length': 3.301255230125523, 'pattern_counts': {'":': 0, '<': 50, '<?xml version=': 0, '>': 20, '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': '1143388', 'n_tokens_mistral': 1131, 'n_tokens_neox': 1069, 'n_words': 313}