Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
90292729
Commit
90292729
authored
9 years ago
by
Van Herck, Walter
Browse files
Options
Downloads
Patches
Plain Diff
Moved ParticleDistribution to IAbstractParticle
parent
120aac55
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Core/Samples/inc/ParticleDistribution.h
+1
-12
1 addition, 12 deletions
Core/Samples/inc/ParticleDistribution.h
Core/Samples/src/ParticleDistribution.cpp
+0
-21
0 additions, 21 deletions
Core/Samples/src/ParticleDistribution.cpp
with
1 addition
and
33 deletions
Core/Samples/inc/ParticleDistribution.h
+
1
−
12
View file @
90292729
...
@@ -27,7 +27,7 @@ class ParticleInfo;
...
@@ -27,7 +27,7 @@ class ParticleInfo;
//! @ingroup samples
//! @ingroup samples
//! @brief A particle with a form factor and refractive index
//! @brief A particle with a form factor and refractive index
class
BA_CORE_API_
ParticleDistribution
:
public
IParticle
class
BA_CORE_API_
ParticleDistribution
:
public
I
Abstract
Particle
{
{
public:
public:
ParticleDistribution
(
const
IParticle
&
prototype
,
const
ParameterDistribution
&
par_distr
);
ParticleDistribution
(
const
IParticle
&
prototype
,
const
ParameterDistribution
&
par_distr
);
...
@@ -59,14 +59,6 @@ public:
...
@@ -59,14 +59,6 @@ public:
return
mP_particle
->
getAmbientMaterial
();
return
mP_particle
->
getAmbientMaterial
();
}
}
//! Should not be called for objects of this class:
//! The object should spawn particles that will create the
//! required form factors
virtual
IFormFactor
*
createTransformedFormFactor
(
complex_t
wavevector_scattering_factor
,
const
IRotation
*
p_rotation
,
kvector_t
translation
)
const
;
//! Initializes list of new particles generated according to a distribution
//! Initializes list of new particles generated according to a distribution
virtual
void
generateParticleInfos
(
std
::
vector
<
const
IParticle
*>&
particle_vector
,
virtual
void
generateParticleInfos
(
std
::
vector
<
const
IParticle
*>&
particle_vector
,
std
::
vector
<
double
>&
abundance_vector
,
std
::
vector
<
double
>&
abundance_vector
,
...
@@ -90,9 +82,6 @@ public:
...
@@ -90,9 +82,6 @@ public:
}
}
private
:
private
:
//! Checks if particle's type is suitable for adding
void
checkParticleType
(
const
IParticle
&
p_particle
);
boost
::
scoped_ptr
<
IParticle
>
mP_particle
;
boost
::
scoped_ptr
<
IParticle
>
mP_particle
;
ParameterDistribution
m_par_distribution
;
ParameterDistribution
m_par_distribution
;
};
};
...
...
This diff is collapsed.
Click to expand it.
Core/Samples/src/ParticleDistribution.cpp
+
0
−
21
View file @
90292729
...
@@ -23,10 +23,6 @@ ParticleDistribution::ParticleDistribution(const IParticle &prototype,
...
@@ -23,10 +23,6 @@ ParticleDistribution::ParticleDistribution(const IParticle &prototype,
:
m_par_distribution
(
par_distr
)
:
m_par_distribution
(
par_distr
)
{
{
setName
(
"ParticleDistribution"
);
setName
(
"ParticleDistribution"
);
registerParameter
(
"position_x"
,
&
m_position
[
0
]);
registerParameter
(
"position_y"
,
&
m_position
[
1
]);
registerParameter
(
"position_z"
,
&
m_position
[
2
]);
checkParticleType
(
prototype
);
mP_particle
.
reset
(
prototype
.
clone
());
mP_particle
.
reset
(
prototype
.
clone
());
registerChild
(
mP_particle
.
get
());
registerChild
(
mP_particle
.
get
());
}
}
...
@@ -44,14 +40,6 @@ ParticleDistribution *ParticleDistribution::cloneInvertB() const
...
@@ -44,14 +40,6 @@ ParticleDistribution *ParticleDistribution::cloneInvertB() const
"cloneInvertB: should never be called"
);
"cloneInvertB: should never be called"
);
}
}
IFormFactor
*
ParticleDistribution
::
createTransformedFormFactor
(
complex_t
,
const
IRotation
*
,
kvector_t
)
const
{
throw
Exceptions
::
NotImplementedException
(
"ParticleDistribution::"
"createTransformedFormFactor: should never be called"
);
}
void
ParticleDistribution
::
generateParticleInfos
(
std
::
vector
<
const
IParticle
*>
&
particle_vector
,
void
ParticleDistribution
::
generateParticleInfos
(
std
::
vector
<
const
IParticle
*>
&
particle_vector
,
std
::
vector
<
double
>
&
abundance_vector
,
double
abundance
)
const
std
::
vector
<
double
>
&
abundance_vector
,
double
abundance
)
const
{
{
...
@@ -110,12 +98,3 @@ void ParticleDistribution::generateParticleInfos(std::vector<const IParticle*> &
...
@@ -110,12 +98,3 @@ void ParticleDistribution::generateParticleInfos(std::vector<const IParticle*> &
abundance_vector
.
push_back
(
particle_abundance
);
abundance_vector
.
push_back
(
particle_abundance
);
}
}
}
}
void
ParticleDistribution
::
checkParticleType
(
const
IParticle
&
p_particle
)
{
const
ParticleDistribution
*
p_distr
=
dynamic_cast
<
const
ParticleDistribution
*>
(
&
p_particle
);
if
(
p_distr
)
{
throw
Exceptions
::
ClassInitializationException
(
"ParticleDistribution::checkParticleType: "
"cannot add ParticleDistribution!"
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment