//#####################################################################
// Copyright 2004-2007, Ron Fedkiw, Geoffrey Irving, Craig Schroeder, Andrew Selle, Tamar Shinar, Eftychios Sifakis, Joseph Teran.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
#include <Core/Parsing/PARSE_ARGS.h>
#include <Deformables/Deformable_Objects/DEFORMABLE_BODY_COLLECTION.h>
#include <Solids/Examples_And_Drivers/SOLIDS_DRIVER.h>
#include <Solids/Solids/SOLID_BODY_COLLECTION.h>
#include <Solids/Solids/SOLIDS_PARAMETERS.h>
#include "STANDARD_TESTS.h"
#include "STANDARD_TESTS_2D.h"
#include <climits>

using namespace PhysBAM;

template<class T,class TV>
void Run(PARSE_ARGS& parse_args,STREAM_TYPE stream_type)
{
    SOLIDS_EXAMPLE<TV>* example;
    example=new STANDARD_TESTS<TV>(stream_type,parse_args);
    SOLIDS_DRIVER<TV> driver(*example);
    driver.Execute_Main_Program();
    delete example;
}

int main(int argc,char* argv[])
{
    bool type_double=true;
    bool use_2d=false;
    PARSE_ARGS parse_args(argc,argv);
    parse_args.Add("-2d",&use_2d,"run 2d sims");
    parse_args.Add_Not("-float",&type_double,"Use floats");
    parse_args.Parse(true);

    if(type_double){
        if(use_2d) Run<double,VECTOR<double,2> >(parse_args,Stream_Type(0.));
        else Run<double,VECTOR<double,3> >(parse_args,Stream_Type(0.));}
    else{
        if(use_2d) Run<float,VECTOR<float,2> >(parse_args,Stream_Type(0.f));
        else Run<float,VECTOR<float,3> >(parse_args,Stream_Type(0.f));}
    return 0;
}
//#####################################################################
