Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
ScalFMM
Commits
5f73e414
Commit
5f73e414
authored
Jan 30, 2015
by
PIACIBELLO Cyrille
Browse files
Chebyshev Api cleaned for HiBOX
parent
c7fae808
Changes
4
Hide whitespace changes
Inline
Side-by-side
Addons/CKernelApi/Src/FInterEngine.hpp
View file @
5f73e414
...
...
@@ -548,7 +548,7 @@ public:
{
typedef
FFmmAlgorithmThread
<
OctreeClass
,
InterCell
,
ContainerClass
,
InterKernel
,
LeafClass
>
AlgoClassThread
;
AlgoClassThread
algoThread
(
octree
,
kernel
);
algoThread
.
execute
();
algoThread
.
execute
(
FFmmNearField
);
break
;
}
case
2
:
...
...
Addons/CKernelApi/Src/FScalfmmApiInit.cpp
View file @
5f73e414
...
...
@@ -24,16 +24,16 @@ extern "C" scalfmm_handle scalfmm_init(/*int TreeHeight,double BoxWidth,double*
handle
->
engine
=
new
FInterEngine
<
ChebCell
,
ChebKernel
>
(
/*TreeHeight,BoxWidth,BoxCenter, */
KernelType
);
break
;
// case 2:
// //TODO typedefs
// typedef FP2PParticleContainerIndexed<> ContainerClass;
// typedef FUnifCell<7> UnifCell;
// case 2:
// //TODO typedefs
// typedef FP2PParticleContainerIndexed<> ContainerClass;
// typedef FUnifCell<7> UnifCell;
// typedef FInterpMatrixKernelR MatrixKernelClass;
// typedef FUnifKernel<UnifCell,ContainerClass,MatrixKernelClass,7> UnifKernel;
// typedef FInterpMatrixKernelR MatrixKernelClass;
// typedef FUnifKernel<UnifCell,ContainerClass,MatrixKernelClass,7> UnifKernel;
// handle->engine = new FInterEngine<UnifCell,UnifKernel>(/*TreeHeight,BoxWidth,BoxCenter, */KernelType);
// break;
// handle->engine = new FInterEngine<UnifCell,UnifKernel>(/*TreeHeight,BoxWidth,BoxCenter, */KernelType);
// break;
default:
std
::
cout
<<
"Kernel type unsupported"
<<
std
::
endl
;
...
...
@@ -168,8 +168,8 @@ extern "C" void ChebKernel_M2M(int level, void* parentCell, int childPosition,
//Get the kernel
ChebKernelStruct
*
inKernelStruct
=
reinterpret_cast
<
UserData
*>
(
inKernel
)
->
kernelStruct
;
inKernelStruct
->
kernel
[
id_thread
]
->
getPtrToInterpolator
()
->
applyM2M
(
childPosition
,
childChebCell
->
getMultipole
(
0
),
parentChebCell
->
getMultipole
(
0
));
childChebCell
->
getMultipole
(
0
),
parentChebCell
->
getMultipole
(
0
));
}
extern
"C"
void
ChebKernel_M2L
(
int
level
,
void
*
targetCell
,
void
*
sourceCell
[
343
],
void
*
inKernel
){
...
...
@@ -198,7 +198,7 @@ extern "C" void ChebKernel_M2L(int level, void* targetCell, void* sourceCell[34
}
extern
"C"
void
ChebKernel_L2L
(
int
level
,
void
*
parentCell
,
int
childPosition
,
void
*
childCell
,
void
*
inKernel
){
//Get our structures
//Get our structures
ChebCellStruct
*
parentCellStruct
=
reinterpret_cast
<
ChebCellStruct
*>
(
parentCell
);
ChebCellStruct
*
childCellStruct
=
reinterpret_cast
<
ChebCellStruct
*>
(
childCell
);
//get real cheb cell
...
...
@@ -211,8 +211,8 @@ extern "C" void ChebKernel_L2L(int level, void* parentCell, int childPosition, v
//Get the kernel
ChebKernelStruct
*
inKernelStruct
=
reinterpret_cast
<
UserData
*>
(
inKernel
)
->
kernelStruct
;
inKernelStruct
->
kernel
[
id_thread
]
->
getPtrToInterpolator
()
->
applyL2L
(
childPosition
,
parentChebCell
->
getLocal
(
0
),
childChebCell
->
getLocal
(
0
));
parentChebCell
->
getLocal
(
0
),
childChebCell
->
getLocal
(
0
));
}
extern
"C"
void
ChebKernel_L2P
(
void
*
leafCell
,
int
nbParticles
,
const
int
*
particleIndexes
,
void
*
inKernel
){
...
...
@@ -221,12 +221,12 @@ extern "C" void ChebKernel_L2P(void* leafCell, int nbParticles, const int* parti
tempContainer
->
reserve
(
nbParticles
);
FPoint
pos
;
for
(
int
i
=
0
;
i
<
nbParticles
;
++
i
){
pos
=
FPoint
(
reinterpret_cast
<
UserData
*>
(
inKernel
)
->
insertedPositions
[
particleIndexes
[
i
]
*
3
],
reinterpret_cast
<
UserData
*>
(
inKernel
)
->
insertedPositions
[
particleIndexes
[
i
]
*
3
+
1
],
reinterpret_cast
<
UserData
*>
(
inKernel
)
->
insertedPositions
[
particleIndexes
[
i
]
*
3
+
2
]);
double
Phi
=
reinterpret_cast
<
UserData
*>
(
inKernel
)
->
myPhyValues
[
particleIndexes
[
i
]];
tempContainer
->
push
(
pos
,
particleIndexes
[
i
],
Phi
);
}
pos
=
FPoint
(
reinterpret_cast
<
UserData
*>
(
inKernel
)
->
insertedPositions
[
particleIndexes
[
i
]
*
3
],
reinterpret_cast
<
UserData
*>
(
inKernel
)
->
insertedPositions
[
particleIndexes
[
i
]
*
3
+
1
],
reinterpret_cast
<
UserData
*>
(
inKernel
)
->
insertedPositions
[
particleIndexes
[
i
]
*
3
+
2
]);
double
Phi
=
reinterpret_cast
<
UserData
*>
(
inKernel
)
->
myPhyValues
[
particleIndexes
[
i
]];
tempContainer
->
push
(
pos
,
particleIndexes
[
i
],
Phi
);
}
//Get our structures
ChebCellStruct
*
leafCellStruct
=
reinterpret_cast
<
ChebCellStruct
*>
(
leafCell
);
//get real cheb cell
...
...
@@ -244,17 +244,17 @@ extern "C" void ChebKernel_L2P(void* leafCell, int nbParticles, const int* parti
double
*
forcesToFill
=
reinterpret_cast
<
UserData
*>
(
inKernel
)
->
forcesComputed
[
id_thread
];
const
FVector
<
int
>&
indexes
=
tempContainer
->
getIndexes
();
for
(
int
idxPart
=
0
;
idxPart
<
nbParticles
;
++
idxPart
){
forcesToFill
[
indexes
[
idxPart
]
*
3
+
0
]
+=
tempContainer
->
getForcesX
()[
idxPart
];
forcesToFill
[
indexes
[
idxPart
]
*
3
+
1
]
+=
tempContainer
->
getForcesY
()[
idxPart
];
forcesToFill
[
indexes
[
idxPart
]
*
3
+
2
]
+=
tempContainer
->
getForcesZ
()[
idxPart
];
}
forcesToFill
[
indexes
[
idxPart
]
*
3
+
0
]
+=
tempContainer
->
getForcesX
()[
idxPart
];
forcesToFill
[
indexes
[
idxPart
]
*
3
+
1
]
+=
tempContainer
->
getForcesY
()[
idxPart
];
forcesToFill
[
indexes
[
idxPart
]
*
3
+
2
]
+=
tempContainer
->
getForcesZ
()[
idxPart
];
}
delete
tempContainer
;
tempContainer
=
nullptr
;
}
void
ChebKernel_P2P
(
int
nbParticles
,
const
int
*
particleIndexes
,
void
ChebKernel_P2P
(
int
nbParticles
,
const
int
*
particleIndexes
,
const
int
*
sourceParticleIndexes
[
27
],
int
sourceNbPart
[
27
],
void
*
inKernel
){
//Create temporary FSimpleLeaf for target
...
...
Addons/CKernelApi/Src/FUserKernelEngine.hpp
View file @
5f73e414
...
...
@@ -474,7 +474,7 @@ public:
{
typedef
FFmmAlgorithmThread
<
OctreeClass
,
CoreCell
,
ContainerClass
,
CoreKernelClass
,
LeafClass
>
AlgoClassThread
;
AlgoClassThread
algoThread
(
octree
,
kernel
);
algoThread
.
execute
();
algoThread
.
execute
(
FFmmNearField
);
break
;
}
case
2
:
...
...
Addons/CKernelApi/Tests/testChebInterface.c
View file @
5f73e414
...
...
@@ -119,14 +119,16 @@ int main(int argc, char ** av){
int
treeHeight
=
atoi
(
av
[
2
]);
}
double
*
particleXYZ
=
malloc
(
sizeof
(
double
)
*
3
*
nbPart
);
double
*
physicalValues
=
malloc
(
sizeof
(
double
)
*
nbPart
);
double
boxWidth
=
1
.
0
;
double
boxCenter
[
3
];
boxCenter
[
0
]
=
boxCenter
[
1
]
=
boxCenter
[
2
]
=
0
.
0
;
//Allocation of the positions and physical values
double
*
particleXYZ
=
malloc
(
sizeof
(
double
)
*
3
*
nbPart
);
double
*
physicalValues
=
malloc
(
sizeof
(
double
)
*
nbPart
);
{
printf
(
"Creating Particles:
\n
"
);
int
idxPart
;
...
...
@@ -274,7 +276,7 @@ int main(int argc, char ** av){
nbPartOkay
++
;
}
else
{
//
printf("id : %d : %e, %e, %e\n",idxPart,diffX,diffY,diffZ);
printf
(
"id : %d : %e, %e, %e
\n
"
,
idxPart
,
diffX
,
diffY
,
diffZ
);
}
//That part is to verify with our usual exec' if everything is alright
if
(
idxPart
==
0
||
idxPart
==
nbPart
/
2
||
idxPart
==
nbPart
-
1
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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