Skip to content
Snippets Groups Projects
Select Git revision
  • 73d8a4d64ccfba231a9f4bb59febee1607aff557
  • master default protected
  • parallel_trapping
  • offload_trapping
  • script_devel
  • unify_iterations
  • containers-m10
  • magma_refinement
  • release9
  • enable_svd
  • parallel_angles_gmu
  • containers-m8
  • parallel_angles
  • profile_omp_leonardo
  • test_nvidia_profiler
  • containers
  • shaditest
  • test1
  • main
  • 3-error-in-run-the-program
  • experiment
  • NP_TMcode-M10a.03
  • NP_TMcode-M10a.02
  • NP_TMcode-M10a.01
  • NP_TMcode-M10a.00
  • NP_TMcode-M9.01
  • NP_TMcode-M9.00
  • NP_TMcode-M8.03
  • NP_TMcode-M8.02
  • NP_TMcode-M8.01
  • NP_TMcode-M8.00
  • NP_TMcode-M7.00
  • v0.0
33 results

test_ParticleDescriptor.cpp

Blame
  • test_ParticleDescriptor.cpp 2.86 KiB
    #include <string>
    
    #ifndef INCLUDE_TYPES_H_
    #include "../include/types.h"
    #endif
    
    #ifndef INCLUDE_ERRORS_H_
    #include "../include/errors.h"
    #endif
    
    #ifndef INCLUDE_CONFIGURATION_H_
    #include "../include/Configuration.h"
    #endif
    
    #ifndef INCLUDE_COMMONS_H_
    #include "../include/Commons.h"
    #endif
    
    using namespace std;
    
    int test_cluster_case_3();
    int test_cluster_devel();
    int test_inclusion();
    int test_sphere();
    
    int main() {
      int result = 0;
      result += test_sphere(); // 1 if failed
      result += test_cluster_devel(); // 10 if failed
      result += test_cluster_case_3(); // 100 if failed
      result += test_inclusion(); // 1000 if failed
      return result;
    }
    
    int test_cluster_case_3() {
      int result = 0;
      try {
        const string geom_data_file = "../../test_data/cluster/case_3/DCLU";
        const string scat_data_file = "../../test_data/cluster/case_3/DEDFB_33";
        GeometryConfiguration *gconf = GeometryConfiguration::from_legacy(geom_data_file);
        ScattererConfiguration *sconf = ScattererConfiguration::from_dedfb(scat_data_file);
        ParticleDescriptor *pd = new ParticleDescriptorCluster(gconf, sconf);
        delete gconf;
        delete sconf;
        delete pd;
      } catch (const exception& ex) {
        result = 100;
      }
      return result;
    }
    
    int test_cluster_devel() {
      int result = 0;
      try {
        const string geom_data_file = "../../test_data/cluster/DCLU";
        const string scat_data_file = "../../test_data/cluster/DEDFB";
        GeometryConfiguration *gconf = GeometryConfiguration::from_legacy(geom_data_file);
        ScattererConfiguration *sconf = ScattererConfiguration::from_dedfb(scat_data_file);
        ParticleDescriptorCluster *pd = new ParticleDescriptorCluster(gconf, sconf);
        delete gconf;
        delete sconf;
        delete pd;
      } catch (const exception& ex) {
        result = 10;
      }
      return result;
    }
    
    int test_inclusion() {
      int result = 0;
      try {
        const string geom_data_file = "../../test_data/inclusion/DINCLU";
        const string scat_data_file = "../../test_data/inclusion/DEDFB";
        GeometryConfiguration *gconf = GeometryConfiguration::from_legacy(geom_data_file);
        ScattererConfiguration *sconf = ScattererConfiguration::from_dedfb(scat_data_file);
        ParticleDescriptorInclusion *pd = new ParticleDescriptorInclusion(gconf, sconf);
        delete gconf;
        delete sconf;
        delete pd;
      } catch (const exception& ex) {
        result = 1000;
      }
      return result;
    }
    
    int test_sphere() {
      int result = 0;
      try {
        const string geom_data_file = "../../test_data/sphere/DSPH";
        const string scat_data_file = "../../test_data/sphere/DEDFB";
        GeometryConfiguration *gconf = GeometryConfiguration::from_legacy(geom_data_file);
        ScattererConfiguration *sconf = ScattererConfiguration::from_dedfb(scat_data_file);
        ParticleDescriptorSphere *pd = new ParticleDescriptorSphere(gconf, sconf);
        delete gconf;
        delete sconf;
        delete pd;
      } catch (const exception& ex) {
        result = 1;
      }
      return result;
    }