Skip to content
Snippets Groups Projects
Commit 7b9b238f authored by Van Herck, Walter's avatar Van Herck, Walter
Browse files

Added test_SampleGeometry() to TestMiscellaneous

parent 3525c61f
No related branches found
No related tags found
No related merge requests found
...@@ -55,6 +55,9 @@ public: ...@@ -55,6 +55,9 @@ public:
//! testing print visitor //! testing print visitor
void test_PrintVisitor(); void test_PrintVisitor();
//! testing specific sample geometries (for debugging purposes)
void test_SampleGeometry();
}; };
#endif // TESTMISCELLANEOUS_H #endif // TESTMISCELLANEOUS_H
......
...@@ -55,9 +55,10 @@ void TestMiscellaneous::execute() ...@@ -55,9 +55,10 @@ void TestMiscellaneous::execute()
//test_KVectorContainer(); //test_KVectorContainer();
//test_OutputDataIOFactory(); //test_OutputDataIOFactory();
//test_FastSin(); //test_FastSin();
test_FormFactor1(); //test_FormFactor1();
//test_FormFactor(); //test_FormFactor();
//test_DrawMesocrystal(); //test_DrawMesocrystal();
test_SampleGeometry();
} }
...@@ -271,7 +272,7 @@ void TestMiscellaneous::test_FormFactor() ...@@ -271,7 +272,7 @@ void TestMiscellaneous::test_FormFactor()
int iz = (int)p_data->getIndexOfAxis("qz", it.getIndex()); int iz = (int)p_data->getIndexOfAxis("qz", it.getIndex());
cvector_t q(x,y,z); cvector_t q(x,y,z);
cvector_t q0(0,0,0); cvector_t q0(0.0,0.0,0.0);
Bin1DCVector q0_bin(q0, q0); Bin1DCVector q0_bin(q0, q0);
Bin1D zero_bin = { 0.0, 0.0 }; Bin1D zero_bin = { 0.0, 0.0 };
double value = std::abs(ff.evaluate(q,q0_bin, zero_bin)); double value = std::abs(ff.evaluate(q,q0_bin, zero_bin));
...@@ -384,7 +385,7 @@ void TestMiscellaneous::test_FormFactor1() ...@@ -384,7 +385,7 @@ void TestMiscellaneous::test_FormFactor1()
double y = p_data->getValueOfAxis("qy", it.getIndex()); double y = p_data->getValueOfAxis("qy", it.getIndex());
cvector_t q(x,y,z); cvector_t q(x,y,z);
cvector_t q0(0,0,0); cvector_t q0(0.0,0.0,0.0);
Bin1DCVector q0_bin(q0, q0); Bin1DCVector q0_bin(q0, q0);
Bin1D zero_bin = { 0.0, 0.0 }; Bin1D zero_bin = { 0.0, 0.0 };
double value = std::abs(ff.evaluate(q,q0_bin, zero_bin)); double value = std::abs(ff.evaluate(q,q0_bin, zero_bin));
...@@ -411,3 +412,36 @@ void TestMiscellaneous::test_FormFactor1() ...@@ -411,3 +412,36 @@ void TestMiscellaneous::test_FormFactor1()
vh2_xy->Draw("cont4 z"); vh2_xy->Draw("cont4 z");
c1_xy->Print("test.eps"); c1_xy->Print("test.eps");
} }
void TestMiscellaneous::test_SampleGeometry()
{
MultiLayer multi_layer;
complex_t n_air(1.0, 0.0);
complex_t n_substrate(1.0-6e-6, 2e-8);
complex_t n_particle(1.0-6e-4, 2e-8);
const IMaterial *p_air_material =
MaterialManager::getHomogeneousMaterial("Air", n_air);
const IMaterial *p_substrate_material =
MaterialManager::getHomogeneousMaterial("Substrate", n_substrate);
const IMaterial *particle_material =
MaterialManager::getHomogeneousMaterial("Particle", n_particle);
Layer air_layer;
air_layer.setMaterial(p_air_material);
ParticleDecoration particle_decoration
(new Particle(particle_material, new FormFactorFullSphere
(5*Units::nanometer)));
air_layer.setDecoration(particle_decoration);
multi_layer.addLayer(air_layer);
Simulation simulation;
simulation.setDetectorParameters(100, -0.2*Units::degree, 0.2*Units::degree,
100, -0.2*Units::degree, 0.2*Units::degree);
simulation.setBeamParameters(0.1*Units::nanometer, 0.2*Units::degree, 0.0);
simulation.setSample(multi_layer);
simulation.runSimulation();
IsGISAXSTools::drawLogOutputData(*simulation.getIntensityData(),
"c1_geom", "Sample geometry", "CONT4 Z", "Sample geometry");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment