#ifndef IOBOX_H
#define IOBOX_H

#include "futile_cst.h"
#include "Box"
#include "DynamicMemory"
#include "DynamicMemory"

namespace Atlab {

void read_field_dimensions(const char* filename,
    char geocode,
    int ndims[3],
    int& nspin);

void read_field(const char* filename,
    char geocode,
    int ndims[3],
    double hgrids[3],
    int& nspin,
    int ldrho,
    int nrho,
    double* rho,
    int (*nat) = nullptr,
    Futile::Double2dPointer (*rxyz) = nullptr,
    Futile::Int1dPointer (*iatypes) = nullptr,
    Futile::Int1dPointer (*znucl) = nullptr);

void dump_field(const char* filename,
    const Cell& mesh,
    int nspin,
    const double* rho,
    const double (*rxyz) = nullptr,
    size_t rxyz_dim_0 = 0,
    size_t rxyz_dim_1 = 0,
    const int (*iatype) = nullptr,
    size_t iatype_dim_0 = 0,
    const int (*nzatom) = nullptr,
    size_t nzatom_dim_0 = 0,
    const int (*nelpsp) = nullptr,
    size_t nelpsp_dim_0 = 0,
    const int (*ixyz0)[3] = nullptr);


}
#endif
