Commit 2125bb43 authored by COULAUD Olivier's avatar COULAUD Olivier
Browse files
parents 5afef1b9 df1a9a74
This diff is collapsed.
......@@ -291,13 +291,18 @@ endif()
set(BLAS_LIBRARY_DIRS "")
string(REPLACE " " ";" BLAS_LIBRARIES "${BLAS_LIBRARIES}")
foreach(blas_lib ${BLAS_LIBRARIES})
string(REPLACE "-L" "" blas_lib "${blas_lib}")
if (EXISTS "${blas_lib}")
list(APPEND BLAS_LIBRARY_DIRS "${blas_lib}" )
else()
get_filename_component(a_blas_lib_dir "${blas_lib}" PATH)
if (EXISTS "${a_blas_lib_dir}")
list(APPEND BLAS_LIBRARY_DIRS "${a_blas_lib_dir}" )
list(APPEND BLAS_LIBRARY_DIRS "${a_blas_lib_dir}" )
else()
string(REPLACE "-L" "" blas_lib "${blas_lib}")
if (EXISTS "${blas_lib}")
list(APPEND BLAS_LIBRARY_DIRS "${blas_lib}" )
else()
get_filename_component(a_blas_lib_dir "${blas_lib}" PATH)
if (EXISTS "${a_blas_lib_dir}")
list(APPEND BLAS_LIBRARY_DIRS "${a_blas_lib_dir}" )
endif()
endif()
endif()
endforeach()
......
......@@ -124,6 +124,7 @@ if (BLAS_FOUND)
# this can be the case with libs such as MKL, ACML
include(CheckFunctionExists)
set(CMAKE_REQUIRED_LIBRARIES "${BLAS_LINKER_FLAGS};${BLAS_LIBRARIES}")
set(CMAKE_REQUIRED_FLAGS "${BLAS_COMPILER_FLAGS}")
unset(CBLAS_WORKS CACHE)
check_function_exists(cblas_dscal CBLAS_WORKS)
mark_as_advanced(CBLAS_WORKS)
......
......@@ -248,13 +248,18 @@ endif()
set(LAPACK_LIBRARY_DIRS "")
string(REPLACE " " ";" LAPACK_LIBRARIES "${LAPACK_LIBRARIES}")
foreach(lapack_lib ${LAPACK_LIBRARIES})
string(REPLACE "-L" "" lapack_lib "${lapack_lib}")
if (EXISTS "${lapack_lib}")
list(APPEND LAPACK_LIBRARY_DIRS "${lapack_lib}" )
else()
get_filename_component(a_lapack_lib_dir "${lapack_lib}" PATH)
if (EXISTS "${a_lapack_lib_dir}")
list(APPEND LAPACK_LIBRARY_DIRS "${a_lapack_lib_dir}" )
list(APPEND LAPACK_LIBRARY_DIRS "${a_lapack_lib_dir}" )
else()
string(REPLACE "-L" "" lapack_lib "${lapack_lib}")
if (EXISTS "${lapack_lib}")
list(APPEND LAPACK_LIBRARY_DIRS "${lapack_lib}" )
else()
get_filename_component(a_lapack_lib_dir "${lapack_lib}" PATH)
if (EXISTS "${a_lapack_lib_dir}")
list(APPEND LAPACK_LIBRARY_DIRS "${a_lapack_lib_dir}" )
endif()
endif()
endif()
endforeach()
......@@ -262,7 +267,6 @@ if (LAPACK_LIBRARY_DIRS)
list(REMOVE_DUPLICATES LAPACK_LIBRARY_DIRS)
endif ()
# check that LAPACK has been found
# ---------------------------------
include(FindPackageHandleStandardArgs)
......
......@@ -230,6 +230,7 @@ foreach(ptscotch_lib ${PTSCOTCH_libs_to_find})
mark_as_advanced(PTSCOTCH_${ptscotch_lib}_LIBRARY)
endforeach()
list(REMOVE_DUPLICATES PTSCOTCH_LIBRARY_DIRS)
# check a function to validate the find
if(PTSCOTCH_LIBRARIES)
......
......@@ -213,6 +213,7 @@ foreach(scotch_lib ${SCOTCH_libs_to_find})
mark_as_advanced(SCOTCH_${scotch_lib}_LIBRARY)
endforeach()
list(REMOVE_DUPLICATES SCOTCH_LIBRARY_DIRS)
# check a function to validate the find
if(SCOTCH_LIBRARIES)
......
......@@ -130,6 +130,10 @@ std::vector<distribution> subparse_file(const std::vector<std::string>& args, st
++i;
}
if(i < args.size() && args[i] == "--file") {
--i;
}
if(gx > 1 || gy > 1 || gz > 1) {
// Compute offset of lowest left grid offset
......
......@@ -4,13 +4,13 @@
// This software is a computer program whose purpose is to compute the FMM.
//
// This software is governed by the CeCILL-C and LGPL licenses and
// abiding by the rules of distribution of free software.
//
// abiding by the rules of distribution of free software.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public and CeCILL-C Licenses for more details.
// "http://www.cecill.info".
// "http://www.cecill.info".
// "http://www.gnu.org/licenses".
// ===================================================================================
#ifndef FBASICCELL_HPP
......@@ -35,8 +35,9 @@
*
*/
class FBasicCell : public FAbstractSerializable {
MortonIndex mortonIndex; //< Morton index (need by most elements)
FTreeCoordinate coordinate; //< The position
MortonIndex mortonIndex; ///< Morton index (need by most elements)
FTreeCoordinate coordinate; ///< The position
std::size_t level; ///< Level in tree
public:
/** Default constructor */
......@@ -45,7 +46,15 @@ public:
/** Default destructor */
virtual ~FBasicCell(){
}
}
std::size_t getLevel() const {
return this->level;
}
void setLevel(std::size_t inLevel) {
this->level = inLevel;
}
/** To get the morton index */
MortonIndex getMortonIndex() const {
......@@ -98,5 +107,3 @@ public:
#endif //FBASICCELL_HPP
......@@ -784,7 +784,7 @@ public:
*/
int getNeighborsNoBrothers(CellClass* inNeighbors[26], const MortonIndex inIndex, const int inLevel) const {
FTreeCoordinate center;
center.setPositionFromMorton(inIndex, inLevel);
center.setPositionFromMorton(inIndex);
const int boxLimite = FMath::pow2(inLevel);
......
......@@ -101,6 +101,8 @@ protected:
treePosition.getY() >> bottomToTop,
treePosition.getZ() >> bottomToTop);
newNode->setLevel(this->subOctreePosition + indexLevel);
this->cells[indexLevel][arrayIndex] = newNode;
--indexLevel;
......
......@@ -243,6 +243,7 @@ FReal plummerDist(FSize& cpt, const FReal &R) {
}
}
/**
* \brief Build N points following the Plummer distribution
*
......@@ -258,11 +259,17 @@ FReal plummerDist(FSize& cpt, const FReal &R) {
*/
template <class FReal>
void unifRandomPlummer(const FSize N, const FReal R, FReal * points) {
constexpr const FReal rand_max = 0.8;
constexpr const FReal r_max = std::sqrt(1.0/(std::pow(rand_max, -2.0/3.0) - 1.0));
unifRandomPointsOnSphere<FReal>(N, 1, points);
FReal mc = 1.0/static_cast<FReal>(N);
for (FSize i = 0, j = 0 ; i< N ; ++i, j+=4) {
FReal m = getRandom<FReal>();
FReal r = FMath::Sqrt( 1.0/(FMath::pow(m, -2.0/3.0) - 1.0)) ;
FReal m = getRandom<FReal>();
while(m > rand_max) {
m = getRandom<FReal>();
}
FReal r = FMath::Sqrt(1.0/(FMath::pow(m, -2.0/3.0) - 1.0)) / r_max * R;
points[j] *= r;
points[j+1] *= r;
points[j+2] *= r;
......
......@@ -51,6 +51,16 @@ public:
symb->mortonIndex = inMortonIndex;
}
/** To get the cell level */
int getLevel() const {
return symb->level;
}
/** To set the cell level */
void setLevel(const int level) {
symb->level = level;
}
/** To get the position */
FTreeCoordinate getCoordinate() const {
return FTreeCoordinate(symb->coordinates[0],
......@@ -103,4 +113,3 @@ public:
#endif // FCHEBCELLPOD_HPP
......@@ -9,7 +9,7 @@
struct alignas(FStarPUDefaultAlign::StructAlign) FBasicCellPOD {
MortonIndex mortonIndex;
int coordinates[3];
int level;
};
#endif // FBASICCELLPOD_HPP
......@@ -99,6 +99,7 @@ public:
CompositeCellClass newNode = newBlock->getCompleteCell(cellIdInBlock);
newNode.setMortonIndex(newNodeIndex);
newNode.setCoordinate(newNodeCoordinate);
newNode.setLevel(idxLevel);
// Add leaf
nbParticlesOffsetBeforeLeaf = newParticleBlock->newLeaf(newNodeIndex, cellIdInBlock,
......@@ -149,6 +150,7 @@ public:
CompositeCellClass newNode = newBlock->getCompleteCell(cellIdInBlock);
newNode.setMortonIndex(newNodeIndex);
newNode.setCoordinate(newNodeCoordinate);
newNode.setLevel(idxLevel);
cellIdInBlock += 1;
blockIteratorInOctree.moveRight();
......
......@@ -53,6 +53,16 @@ public:
symb->mortonIndex = inMortonIndex;
}
/** To get the cell level */
int getLevel() const {
return symb->level;
}
/** To set the cell level */
void setLevel(const int level) {
symb->level = level;
}
/** To get the position */
FTreeCoordinate getCoordinate() const {
return FTreeCoordinate(symb->coordinates[0],
......@@ -109,4 +119,3 @@ public:
#endif // FROTATIONCELLPOD_HPP
......@@ -51,6 +51,16 @@ public:
symb->mortonIndex = inMortonIndex;
}
/** To get the cell level */
int getLevel() const {
return symb->level;
}
/** To set the cell level */
void setLevel(const int level) {
symb->level = level;
}
/** To get the position */
FTreeCoordinate getCoordinate() const {
return FTreeCoordinate(symb->coordinates[0],
......@@ -102,4 +112,3 @@ public:
};
#endif // FTAYLORCELLPOD_HPP
......@@ -34,6 +34,16 @@ public:
symb->mortonIndex = inMortonIndex;
}
/** To get the cell level */
int getLevel() const {
return symb->level;
}
/** To set the cell level */
void setLevel(const int level) {
symb->level = level;
}
/** To get the position */
FTreeCoordinate getCoordinate() const {
return FTreeCoordinate(symb->coordinates[0],
......@@ -81,4 +91,3 @@ public:
#endif // FTESTCELLPOD_HPP
......@@ -51,6 +51,16 @@ public:
symb->mortonIndex = inMortonIndex;
}
/** To get the cell level */
int getLevel() const {
return symb->level;
}
/** To set the cell level */
void setLevel(const int level) {
symb->level = level;
}
/** To get the position */
FTreeCoordinate getCoordinate() const {
return FTreeCoordinate(symb->coordinates[0],
......@@ -129,4 +139,3 @@ public:
};
#endif // FUNIFCELLPOD_HPP
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment