mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 23:31:12 +00:00
Update cosmotool 2nd part
This commit is contained in:
parent
64e05fc180
commit
003bc39d4a
70 changed files with 8708 additions and 0 deletions
29
external/cosmotool/python/safe_gadget.hpp
vendored
Normal file
29
external/cosmotool/python/safe_gadget.hpp
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
#include "config.hpp"
|
||||
#include "loadGadget.hpp"
|
||||
#include <string>
|
||||
|
||||
static inline
|
||||
CosmoTool::SimuData *loadGadgetMulti_safe(const std::string& fname, int flags, int gadgetFormat)
|
||||
{
|
||||
try
|
||||
{
|
||||
return CosmoTool::loadGadgetMulti(fname.c_str(), -1, flags, gadgetFormat);
|
||||
}
|
||||
catch (const CosmoTool::Exception& e)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static inline
|
||||
CosmoTool::SimuData **alloc_simudata(int n)
|
||||
{
|
||||
return new CosmoTool::SimuData *[n];
|
||||
}
|
||||
|
||||
static inline
|
||||
void del_simudata(CosmoTool::SimuData **s)
|
||||
{
|
||||
delete[] s;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue