Skip to content
Snippets Groups Projects
Commit 24b78bdf authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

deb msgs

parent 0ab27b3d
No related branches found
No related tags found
1 merge request!560Resolve Decorator Pattern in IFormFactor hierarchy
......@@ -14,9 +14,11 @@
#include "Sample/Scattering/DecoratedFF.h"
#include "Base/Vector/RotMatrix.h"
#include "Base/Vector/WavevectorInfo.h" // debug
#include "Sample/Material/Material.h"
#include "Sample/Material/MaterialFactoryFuncs.h"
#include "Sample/Scattering/Rotations.h"
#include <iostream>
DecoratedFF::DecoratedFF(IDecoratableBorn* ff, const Material& material,
const Material& ambient_material, const R3* position,
......@@ -66,10 +68,13 @@ void DecoratedFF::setRotMatrix(const RotMatrix& rotMatrix)
complex_t DecoratedFF::theFF(const WavevectorInfo& wavevectors) const
{
std::cout << "DEBUG DecoratedFF::theFF, q=" << wavevectors.getQ() << std::endl;
complex_t result = m_ff->theFF(wavevectors);
std::cout << "-> sub result = " << result << std::endl;
if (m_material && m_ambient_material)
result = (m_material->scalarSubtrSLD(wavevectors)
- m_ambient_material->scalarSubtrSLD(wavevectors)) * result;
std::cout << "-> final result = " << result << std::endl;
return result;
}
......
......@@ -36,7 +36,12 @@ double FormFactorDecoratorPositionFactor::topZ(const IRotation* rotation) const
complex_t FormFactorDecoratorPositionFactor::theFF(const WavevectorInfo& wavevectors) const
{
return exp_I(m_position->dot(wavevectors.getQ())) * m_ff->theFF(wavevectors);
std::cout << "DEBUG FFDecPos::theFF, q=" << wavevectors.getQ() << std::endl;
complex_t result = m_ff->theFF(wavevectors);
std::cout << "-> sub result = " << result << std::endl;
result *= exp_I(m_position->dot(wavevectors.getQ()));
std::cout << "-> final result = " << result << std::endl;
return result;
}
Eigen::Matrix2cd
......
......@@ -47,6 +47,9 @@ double FormFactorDecoratorRotation::topZ(const IRotation* rotation) const
complex_t FormFactorDecoratorRotation::theFF(const WavevectorInfo& wavevectors) const
{
std::cout << "DEBUG FFDecPos::theFF, q=" << wavevectors.getQ() << std::endl;
std::cout << " transformed q=" << wavevectors.transformed(m_rotMatrix->getInverse()).getQ()
<< std::endl;
return m_ff->theFF(wavevectors.transformed(m_rotMatrix->getInverse()));
}
......
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