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
6dfaa9bf
Commit
6dfaa9bf
authored
Mar 26, 2015
by
BRAMAS Berenger
Browse files
Merge branch 'master' of
git+ssh://scm.gforge.inria.fr//gitroot//scalfmm/scalfmm
parents
5d95ac2d
bfd083c2
Changes
4
Hide whitespace changes
Inline
Side-by-side
NEWS.txt
View file @
6dfaa9bf
...
...
@@ -6,6 +6,7 @@ Copyright (c) 2011-2014 Inria, All rights reserved.
This file contains the main features as well as overviews of specific
bug fixes (and other actions) for each version of ScalFMM since
version 1.1
1.3 in progress
-----
- The choice of floating point values is done by template (by passing template to all classes) and no more at configure time
...
...
Src/Kernels/Chebyshev/FChebKernel.hpp
View file @
6dfaa9bf
...
...
@@ -77,7 +77,7 @@ public:
}
FChebKernel
(
const
int
inTreeHeight
,
const
FReal
inBoxWidth
,
const
FPoint
<
FReal
>&
inBoxCenter
,
const
MatrixKernelClass
*
const
inMatrixKernel
)
:
FChebKernel
(
inTreeHeight
,
inBoxWidth
,
inBoxCenter
,
inMatrixKernel
,
FReal
(
0.
)
/*
FMath::pow(10.0,static_cast<FReal>(-ORDER))
*/
)
:
FChebKernel
(
inTreeHeight
,
inBoxWidth
,
inBoxCenter
,
inMatrixKernel
,
FMath
::
pow
(
10.0
,
static_cast
<
FReal
>
(
-
ORDER
)))
{
}
...
...
UTests/utestChebyshevDirectPeriodic.cpp
View file @
6dfaa9bf
...
...
@@ -23,6 +23,7 @@
#include
"Containers/FOctree.hpp"
#include
"Containers/FVector.hpp"
#include
"Files/FFmaGenericLoader.hpp"
#include
"Files/FRandomLoader.hpp"
#include
"Files/FTreeIO.hpp"
...
...
@@ -55,31 +56,37 @@ class TestChebyshevDirect : public FUTester<TestChebyshevDirect> {
template
<
class
FReal
,
class
CellClass
,
class
ContainerClass
,
class
KernelClass
,
class
MatrixKernelClass
,
class
LeafClass
,
class
OctreeClass
,
class
FmmClass
>
void
RunTest
()
{
void
RunTest
(
bool
readFile
=
false
)
{
// Warning in make test the exec dir it Build/UTests
// Load particles
const
int
NbLevels
=
4
;
const
int
SizeSubLevels
=
2
;
const
int
PeriodicDeep
=
2
;
const
int
NbParticles
=
250
;
const
int
PeriodicDeep
=
3
;
int
NbParticles
=
150
;
FReal
BoxWidth
;
FPoint
<
FReal
>
CenterOfBox
;
FRandomLoader
<
FReal
>
loader
(
NbParticles
);
BoxWidth
=
loader
.
getBoxWidth
();
CenterOfBox
=
loader
.
getCenterOfBox
();
NbParticles
=
loader
.
getNumberOfParticles
();
Print
(
"Number of particles:"
);
Print
(
loader
.
getNumberOfParticles
());
// Create octree
OctreeClass
tree
(
NbLevels
,
SizeSubLevels
,
loader
.
getBoxWidth
(),
loader
.
get
CenterOfBox
()
);
OctreeClass
tree
(
NbLevels
,
SizeSubLevels
,
BoxWidth
,
CenterOfBox
);
// interaction kernel evaluator
const
MatrixKernelClass
MatrixKernel
;
struct
TestParticle
{
FPoint
<
FReal
>
position
;
FReal
forces
[
3
];
FReal
physicalValue
;
FReal
potential
;
FReal
forces
[
3
];
};
FReal
coeff
=
-
1.0
,
value
=
0.10
,
sum
=
0.0
;
TestParticle
*
const
particles
=
new
TestParticle
[
loader
.
getNumberOfParticles
()];
...
...
@@ -99,14 +106,19 @@ class TestChebyshevDirect : public FUTester<TestChebyshevDirect> {
particles
[
idxPart
].
forces
[
1
]
=
0.0
;
particles
[
idxPart
].
forces
[
2
]
=
0.0
;
}
if
(
FMath
::
Abs
(
sum
)
>
0.00001
){
std
::
cerr
<<
"Sum of charges is not equal zero!!! (sum=<<"
<<
sum
<<
" )"
<<
std
::
endl
;
exit
(
-
1
);
}
/////////////////////////////////////////////////////////////////////////////////////////////////
// Run FMM computation
/////////////////////////////////////////////////////////////////////////////////////////////////
Print
(
"Fmm..."
);
FmmClass
algo
(
&
tree
,
PeriodicDeep
);
KernelClass
kernels
(
algo
.
extendedTreeHeight
(),
algo
.
extendedBoxWidth
(),
algo
.
extendedBoxCenter
(),
&
MatrixKernel
);
algo
.
setKernel
(
&
kernels
);
KernelClass
*
kernels
=
new
KernelClass
(
algo
.
extendedTreeHeight
(),
algo
.
extendedBoxWidth
(),
algo
.
extendedBoxCenter
(),
&
MatrixKernel
);
algo
.
setKernel
(
kernels
);
algo
.
execute
();
delete
kernels
;
/////////////////////////////////////////////////////////////////////////////////////////////////
// Run direct computation
/////////////////////////////////////////////////////////////////////////////////////////////////
...
...
@@ -186,9 +198,6 @@ class TestChebyshevDirect : public FUTester<TestChebyshevDirect> {
}
});
}
delete
[]
particles
;
// Print for information
Print
(
"Potential diff is = "
);
...
...
@@ -219,16 +228,37 @@ class TestChebyshevDirect : public FUTester<TestChebyshevDirect> {
uassert
(
potentialDiff
.
getL2Norm
()
<
MaximumDiffPotential
);
//1
uassert
(
potentialDiff
.
getRMSError
()
<
MaximumDiffPotential
);
//2
//
uassert(potentialDiff.getRMSError() < MaximumDiffPotential); //2
uassert
(
fx
.
getL2Norm
()
<
MaximumDiffForces
);
//3
uassert
(
fx
.
getRMSError
()
<
MaximumDiffForces
);
//4
//
uassert(fx.getRMSError() < MaximumDiffForces); //4
uassert
(
fy
.
getL2Norm
()
<
MaximumDiffForces
);
//5
uassert
(
fy
.
getRMSError
()
<
MaximumDiffForces
);
//6
//
uassert(fy.getRMSError() < MaximumDiffForces); //6
uassert
(
fz
.
getL2Norm
()
<
MaximumDiffForces
);
//8
uassert
(
fz
.
getRMSError
()
<
MaximumDiffForces
);
//8
//
uassert(fz.getRMSError() < MaximumDiffForces); //8
uassert
(
L2error
<
MaximumDiffForces
);
//9 Total Force
uassert
(
FMath
::
Abs
(
energy
-
energyD
)
<
10
*
MaximumDiffPotential
);
//10 Total Energy
//
// ----------------------------------------------------------------
// Save computation in binary format
//
// 2 is for PeriodicDeep
// std::string filenameOut("../Data/UTest/DirectPer2Double.bfma");
// std::cout << "Generate " << filenameOut <<" for output file" << std::endl;
// //
// std::cout << " nbParticles: " << NbParticles <<" " << sizeof(NbParticles) <<std::endl;
// std::cout << " Box size: " << loader.getBoxWidth() << " " << sizeof(loader.getBoxWidth())<<std::endl;
// //
// FFmaGenericWriter<FReal> writer(filenameOut) ;
//
// writer.writeHeader( loader.getCenterOfBox(),loader.getBoxWidth(), NbParticles,8,8) ;
// // writer.writeArrayOfParticlesp(articles, NbParticles);
// writer.writeArrayOfReal(particles[0].position.getDataValue(), 8, NbParticles);
delete
[]
particles
;
}
/** If memstas is running print the memory used */
...
...
UTests/utestRotationDirectPeriodic.cpp
View file @
6dfaa9bf
...
...
@@ -134,6 +134,7 @@ class TestRotationDirectPeriodic : public FUTester<TestRotationDirectPeriodic> {
}
}
}
delete
kernel
;
FReal
energy
=
0.0
,
energyD
=
0.0
;
/////////////////////////////////////////////////////////////////////////////////////////////////
// Compute direct energy
...
...
@@ -225,8 +226,8 @@ class TestRotationDirectPeriodic : public FUTester<TestRotationDirectPeriodic> {
Print
(
"Test10 - Relative error Energy "
);
uassert
(
FMath
::
Abs
(
energy
-
energyD
)
<
coerr
*
MaximumDiffPotential
);
//10 Total Energy
//
delete
[]
particles
;
}
/** After check the memory if needed */
...
...
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