Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
ScalFMM
Commits
ce844df5
Commit
ce844df5
authored
May 25, 2015
by
COULAUD Olivier
Browse files
Fix some mistakes in the documentation.
Improvement in gnuplot script for histogram
parent
951555b1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Doc/noDist/Notes/distribution.pdf
View file @
ce844df5
No preview for this file type
Doc/noDist/Notes/distribution.tex
View file @
ce844df5
...
...
@@ -34,7 +34,7 @@ then we obtain a uniform distribution of points on the unit sphere.
\includegraphics
[width=0.3\textwidth]
{
unitsphere
}
\caption
{$
5
\,
000
$
points distribution on unit sphere.
}
%
\end{figure}
\texttt
{
generateDistributions -unitsphere -N 5000 -f
ilename
unitsphere -visu
}
\texttt
{
generateDistributions -unitsphere -N 5000 -f
out
unitsphere
.fma
-
f
visu
out unitsphere.vtp
}
\subsection
{
Ellipsoid distribution
}
...
...
@@ -76,7 +76,7 @@ is true then we keep the point otherwise we reject it.
\end{minipage}
%
\end{figure}
\texttt
{
generateDistributions -prolate -ar 1:1:10 -N 20000 -f
ilename
prolate -visu
}
\texttt
{
generateDistributions -prolate -ar 1:1:10 -N 20000 -f
out
prolate
.bfma
-
f
visu
out prolate.vtp
}
...
...
@@ -100,7 +100,7 @@ As shown in the figure~\ref{Fig-nonUnifEllipsoid} we obtain a concentration of p
This bias on the pole could be reduced by choosing the same approach that we use to build a uniform distribution on the unit sphere?
\texttt
{
generateDistributions -ellipsoid -ar 2:2:4 -N 20000 -f
ilename
ellipsoid -visu
}
\texttt
{
generateDistributions -ellipsoid -ar 2:2:4 -N 20000 -f
out
ellipsoid
.bfma
-
f
visu
out ellipsoid.vtp
}
If you consider the
...
...
@@ -125,7 +125,8 @@ r = \sqrt{\frac{u^{2/3}}{u^{2/3}-1}}
\end{figure}
The command to generate such distribution is
\\
\texttt
{
generateDistributions -plummer -radius 10 -N 50000 -filename plummer -visu
}
\texttt
{
generateDistributions -plummer -radius 10 -N 50000 -fout plummer.bfma -fvisuout plummer.vtp
}
...
...
Examples/generateDistributions.cpp
View file @
ce844df5
...
...
@@ -38,11 +38,11 @@
//! <b> General arguments:</b>
//! \param -help (-h) to see the parameters available in this driver
//! \param -N The number of points in the distribution (default 20000)
//! \param -f
ilename
name: generic name for files (with extension) and save data
//! \param -f
out
name: generic name for files (with extension) and save data
//! with following format in name.fma or name.bfma in -bin is set"
//! \param -visu
fmt format
for the visu file (vtk, vtp, cvs or cosmo). vtp is the default
//! \param -
f
visu
out Filename
for the visu file (vtk, vtp, cvs or cosmo). vtp is the default
//! \param -extraLength value extra length to add to the boxWidth (default 0.0)
//!
//! <b> Geometry arguments:</b>
//! \param -unitCube uniform distribution on unit cube
//! \param -cube uniform distribution on a cube
...
...
@@ -65,11 +65,11 @@
//!
//! \b examples
//!
//! generateDistributions -prolate -ar 2:2:4 -N 20000 -f
ilename
prolate
//! generateDistributions -prolate -ar 2:2:4 -N 20000 -f
out
prolate
//!
//! or
//!
//!
generateDistributions
-cuboid 2:2:4 -
filename
cuboid -visu
fmt
vtp -charge -zeromean
//! generateDistributions -cuboid 2:2:4 -
N 100000 -fout
cuboid
.bfma
-
f
visu
out cuboid.
vtp -charge -zeromean
//!
...
...
Tests/noDist/testAdaptiveUnifFMM.cpp
View file @
ce844df5
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Berenger Bramas,
Matthias Messner
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Berenger Bramas,
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
...
...
@@ -93,13 +93,13 @@ int main(int argc, char ** argv){
}
std
::
cout
<<
std
::
endl
<<
std
::
endl
;
// ---------------------------------------------
const
std
::
string
fileName
(
FParameters
::
getStr
(
argc
,
argv
,
FParameterDefinitions
::
InputFile
.
options
,
"../Data/noDistprolate50.out.fma"
));
const
std
::
string
fileName
(
FParameters
::
getStr
(
argc
,
argv
,
FParameterDefinitions
::
InputFile
.
options
,
"../Data/noDist
/
prolate50.out.fma"
));
const
unsigned
int
TreeHeight
=
FParameters
::
getValue
(
argc
,
argv
,
FParameterDefinitions
::
OctreeHeight
.
options
,
3
);
const
unsigned
int
SubTreeHeight
=
FParameters
::
getValue
(
argc
,
argv
,
FParameterDefinitions
::
OctreeSubHeight
.
options
,
2
);
// const unsigned int NbThreads = FParameters::getValue(argc, argv, FParameterDefinitions::NbThreads.options, 1);
//
// accuracy
const
unsigned
int
P
=
7
;
const
unsigned
int
P
=
4
;
const
int
sminM
=
FParameters
::
getValue
(
argc
,
argv
,
LocalOptionMinMultipoleThreshod
.
options
,
P
*
P
*
P
);
...
...
@@ -107,9 +107,9 @@ int main(int argc, char ** argv){
//
typedef
double
FReal
;
typedef
FUnifCell
<
FReal
,
P
>
CellClass
;
typedef
FP2PParticleContainerIndexed
<
FReal
>
ContainerClass
;
typedef
FSimpleIndexedLeaf
<
FReal
,
ContainerClass
>
LeafClass
;
typedef
FInterpMatrixKernelR
<
FReal
>
MatrixKernelClass
;
typedef
FP2PParticleContainerIndexed
<
FReal
>
ContainerClass
;
typedef
FSimpleIndexedLeaf
<
FReal
,
ContainerClass
>
LeafClass
;
typedef
FInterpMatrixKernelR
<
FReal
>
MatrixKernelClass
;
//
typedef
FAdaptiveUnifKernel
<
FReal
,
CellClass
,
ContainerClass
,
MatrixKernelClass
,
P
>
KernelClass
;
//
...
...
@@ -223,7 +223,7 @@ int main(int argc, char ** argv){
const
FReal
*
const
forcesX
=
leaf
->
getTargets
()
->
getForcesX
();
const
FReal
*
const
forcesY
=
leaf
->
getTargets
()
->
getForcesY
();
const
FReal
*
const
forcesZ
=
leaf
->
getTargets
()
->
getForcesZ
();
const
FSize
nbParticlesInLeaf
=
leaf
->
getTargets
()
->
getNbParticles
();
const
FSize
nbParticlesInLeaf
=
leaf
->
getTargets
()
->
getNbParticles
();
const
FVector
<
FSize
>&
indexes
=
leaf
->
getTargets
()
->
getIndexes
();
for
(
FSize
idxPart
=
0
;
idxPart
<
nbParticlesInLeaf
;
++
idxPart
){
...
...
Utils/scripts/hist.gnu
View file @
ce844df5
...
...
@@ -9,21 +9,21 @@ set key off
set border 3
# Add a vertical dotted line at x=0 to show centre (mean) of distribution.
set yzeroaxis
# Each bar is half the (visual) width of its x-range.
set boxwidth 0.05 absolute
set style fill solid 1.0 noborder
bin_width = 0.1;
bin_number(x) = floor(x/bin_width)
rounded(x) = bin_width * ( bin_number(x) + 0.5 )
#
#
set ylabel "Number of leaves"
set xabel "Number of Particles"
set xlabel "Number of Particles per box"
#
# OUTPUT
set terminal postscript enhanced color 'Helvetica' 20
set output 'Histogram.eps'
#
# PLOT
#
set style data histogram
set style histogram cluster gap 1
#unset ytics
set boxwidth 0.75
set style fill solid 1.0 noborder
plot 'output.txt' using (rounded($1)):($2) smooth frequency with boxes
\ No newline at end of file
plot 'output.txt' using ($1,$2) with boxes
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment