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

Replaced refractive index by IMaterial in DiffuseDWBASimulation

parent db5ebcee
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ class DiffuseDWBASimulation: public LayerDWBASimulation ...@@ -23,7 +23,7 @@ class DiffuseDWBASimulation: public LayerDWBASimulation
{ {
public: public:
DiffuseDWBASimulation() DiffuseDWBASimulation()
: m_refractive_index(1., 0.), m_surface_density(1.) {} : m_surface_density(1.0) {}
virtual ~DiffuseDWBASimulation() {} virtual ~DiffuseDWBASimulation() {}
...@@ -34,7 +34,7 @@ public: ...@@ -34,7 +34,7 @@ public:
void addParticleInfo(DiffuseParticleInfo *p_info) void addParticleInfo(DiffuseParticleInfo *p_info)
{ m_np_infos.push_back(p_info); } { m_np_infos.push_back(p_info); }
void setRefractiveIndex(complex_t n) { m_refractive_index = n; } void setMaterial(const IMaterial *p_material);
void setSurfaceDensity(double surface_density) void setSurfaceDensity(double surface_density)
{ m_surface_density = surface_density; } { m_surface_density = surface_density; }
...@@ -45,8 +45,7 @@ public: ...@@ -45,8 +45,7 @@ public:
m_np_infos[np_index]->scaleAbundance(factor); m_np_infos[np_index]->scaleAbundance(factor);
} }
protected: private:
complex_t m_refractive_index;
double m_surface_density; double m_surface_density;
SafePointerVector<DiffuseParticleInfo> m_np_infos; SafePointerVector<DiffuseParticleInfo> m_np_infos;
struct DiffuseFormFactorTerm { struct DiffuseFormFactorTerm {
......
...@@ -111,8 +111,19 @@ void DiffuseDWBASimulation::run() ...@@ -111,8 +111,19 @@ void DiffuseDWBASimulation::run()
} }
} }
//! Initializes vector<DiffuseFormFactorTerm*> term. void DiffuseDWBASimulation::setMaterial(const IMaterial* p_material)
{
SafePointerVector<DiffuseParticleInfo>::iterator it =
m_np_infos.begin();
while (it != m_np_infos.end()) {
(*it)->setAmbientMaterial(p_material);
++it;
}
}
//! Initializes vector<DiffuseFormFactorTerm*> term.
//!
//! Called near beginning of this->run(). //! Called near beginning of this->run().
//! Collect one entry (p_diffuse_term) per particle type and layer[?]. //! Collect one entry (p_diffuse_term) per particle type and layer[?].
//! For each entry, set //! For each entry, set
...@@ -162,5 +173,3 @@ void DiffuseDWBASimulation::initDiffuseFormFactorTerms( ...@@ -162,5 +173,3 @@ void DiffuseDWBASimulation::initDiffuseFormFactorTerms(
} }
} }
...@@ -157,7 +157,6 @@ DiffuseDWBASimulation* Layer::createDiffuseDWBASimulation() const ...@@ -157,7 +157,6 @@ DiffuseDWBASimulation* Layer::createDiffuseDWBASimulation() const
if (p_diffuse_nps) { if (p_diffuse_nps) {
for (size_t j=0; j<p_diffuse_nps->size(); ++j) { for (size_t j=0; j<p_diffuse_nps->size(); ++j) {
DiffuseParticleInfo *p_diff_info = (*p_diffuse_nps)[j]; DiffuseParticleInfo *p_diff_info = (*p_diffuse_nps)[j];
p_diff_info->setAmbientMaterial(p_layer_material);
p_diff_info->setNumberPerMeso( p_diff_info->setNumberPerMeso(
particle_density * p_info->getAbundance() * particle_density * p_info->getAbundance() *
p_diff_info->getNumberPerMeso()); p_diff_info->getNumberPerMeso());
...@@ -170,7 +169,7 @@ DiffuseDWBASimulation* Layer::createDiffuseDWBASimulation() const ...@@ -170,7 +169,7 @@ DiffuseDWBASimulation* Layer::createDiffuseDWBASimulation() const
} }
} }
if (p_sim->getSize()>0) { if (p_sim->getSize()>0) {
p_sim->setRefractiveIndex(getRefractiveIndex()); p_sim->setMaterial(p_layer_material);
return p_sim; return p_sim;
} }
delete p_sim; delete p_sim;
......
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