Loading src/TNL/CMakeLists.txt +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ set( headers StaticFor.h String.h Timer.h terminal-colors.h UniquePointer.h ) set( common_SOURCES Loading src/TNL/Communicators/MpiCommunicator.h +11 −11 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ class MpiCommunicator static bool isDistributed() { return GetSize(AllGroup)>1; }; } static void configSetup( Config::ConfigDescription& config, const String& prefix = "" ) { Loading Loading @@ -125,7 +125,7 @@ class MpiCommunicator } } #endif }; } static void Finalize() { Loading @@ -140,7 +140,7 @@ class MpiCommunicator } MPI_Finalize(); #endif }; } static bool IsInitialized() { Loading @@ -152,7 +152,7 @@ class MpiCommunicator #else return false; #endif }; } static int GetRank(CommunicationGroup group) { Loading @@ -164,7 +164,7 @@ class MpiCommunicator #else return 1; #endif }; } static int GetSize(CommunicationGroup group) { Loading @@ -176,7 +176,7 @@ class MpiCommunicator #else return 1; #endif }; } //dim-number of dimesions, distr array of guess distr - 0 for computation //distr array will be filled by computed distribution Loading @@ -201,7 +201,7 @@ class MpiCommunicator MPI_Dims_create(nproc, dim, distr); #endif }; } static void Barrier(CommunicationGroup comm) { Loading @@ -211,7 +211,7 @@ class MpiCommunicator #else throw Exceptions::MPISupportMissing(); #endif }; } template <typename T> static Request ISend( const T *data, int count, int dest, CommunicationGroup group) Loading Loading @@ -247,7 +247,7 @@ class MpiCommunicator #else throw Exceptions::MPISupportMissing(); #endif }; } template< typename T > static void Bcast( T& data, int count, int root,CommunicationGroup group) Loading @@ -272,7 +272,7 @@ class MpiCommunicator #else throw Exceptions::MPISupportMissing(); #endif }; } template< typename T > Loading @@ -288,7 +288,7 @@ class MpiCommunicator #else throw Exceptions::MPISupportMissing(); #endif }; } static void writeProlog( Logger& logger ) Loading src/TNL/Communicators/NoDistrCommunicator.h +8 −8 Original line number Diff line number Diff line Loading @@ -53,22 +53,22 @@ class NoDistrCommunicator static bool IsInitialized() { return true; }; } static bool isDistributed() { return false; }; } static int GetRank(CommunicationGroup group) { return 0; }; } static int GetSize(CommunicationGroup group) { return 1; }; } static void DimsCreate(int nproc, int dim, int *distr) { Loading @@ -76,7 +76,7 @@ class NoDistrCommunicator { distr[i]=1; } }; } static void Barrier(CommunicationGroup group) { Loading @@ -96,7 +96,7 @@ class NoDistrCommunicator static void WaitAll(Request *reqs, int length) { }; } template< typename T > static void Bcast( T& data, int count, int root, CommunicationGroup group) Loading @@ -111,7 +111,7 @@ class NoDistrCommunicator CommunicationGroup group ) { memcpy( ( void* ) reduced_data, ( void* ) data, count * sizeof( T ) ); }; } template< typename T > static void Reduce( T* data, Loading @@ -122,7 +122,7 @@ class NoDistrCommunicator CommunicationGroup group ) { memcpy( ( void* ) reduced_data, ( void* ) data, count * sizeof( T ) ); }; } static void writeProlog( Logger& logger ){}; }; Loading src/Tools/tnl-lattice-init.h +30 −15 Original line number Diff line number Diff line Loading @@ -89,6 +89,10 @@ bool performExtrude( const Config::ParameterContainer& parameters, ProfilePointType aux2( rotationCos * aux1.x() - rotationSin * aux1.y(), rotationSin * aux1.x() + rotationCos * aux1.y() ); aux1 = profileCenter + aux2; if( aux1.x() >= 0 && aux1.y() >= 0 && aux1.x() <= profileMesh.getProportions().x() && aux1.y() <= profileMesh.getProportions().y() ) { profileCell.getCoordinates().x() = aux1.x() / profileMesh.getSpaceSteps().x(); profileCell.getCoordinates().y() = aux1.y() / profileMesh.getSpaceSteps().y(); profileCell.refresh(); Loading @@ -96,6 +100,7 @@ bool performExtrude( const Config::ParameterContainer& parameters, if( aux ) f( cell ) = aux; } } } if( profileOrientation == "y" ) { if( p.x() < profileMesh.getOrigin().x() || Loading @@ -114,6 +119,10 @@ bool performExtrude( const Config::ParameterContainer& parameters, ProfilePointType aux2( rotationCos * aux1.x() - rotationSin * aux1.y(), rotationSin * aux1.x() + rotationCos * aux1.y() ); aux1 = profileCenter + aux2; if( aux1.x() >= 0 && aux1.y() >= 0 && aux1.x() <= profileMesh.getProportions().x() && aux1.y() <= profileMesh.getProportions().y() ) { profileCell.getCoordinates().x() = aux1.x() / profileMesh.getSpaceSteps().x(); profileCell.getCoordinates().y() = aux1.y() / profileMesh.getSpaceSteps().y(); profileCell.refresh(); Loading @@ -121,6 +130,7 @@ bool performExtrude( const Config::ParameterContainer& parameters, if( aux ) f( cell ) = aux; } } } if( profileOrientation == "z" ) { if( p.x() < profileMesh.getOrigin().x() || Loading @@ -139,6 +149,10 @@ bool performExtrude( const Config::ParameterContainer& parameters, ProfilePointType aux2( rotationCos * aux1.x() - rotationSin * aux1.y(), rotationSin * aux1.x() + rotationCos * aux1.y() ); aux1 = profileCenter + aux2; if( aux1.x() >= 0 && aux1.y() >= 0 && aux1.x() <= profileMesh.getProportions().x() && aux1.y() <= profileMesh.getProportions().y() ) { profileCell.getCoordinates().x() = aux1.x() / profileMesh.getSpaceSteps().x(); profileCell.getCoordinates().y() = aux1.y() / profileMesh.getSpaceSteps().y(); profileCell.refresh(); Loading @@ -147,6 +161,7 @@ bool performExtrude( const Config::ParameterContainer& parameters, } } } } String outputFile = parameters.getParameter< String >( "output-file" ); if( ! f.save( outputFile ) ) { Loading Loading
src/TNL/CMakeLists.txt +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ set( headers StaticFor.h String.h Timer.h terminal-colors.h UniquePointer.h ) set( common_SOURCES Loading
src/TNL/Communicators/MpiCommunicator.h +11 −11 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ class MpiCommunicator static bool isDistributed() { return GetSize(AllGroup)>1; }; } static void configSetup( Config::ConfigDescription& config, const String& prefix = "" ) { Loading Loading @@ -125,7 +125,7 @@ class MpiCommunicator } } #endif }; } static void Finalize() { Loading @@ -140,7 +140,7 @@ class MpiCommunicator } MPI_Finalize(); #endif }; } static bool IsInitialized() { Loading @@ -152,7 +152,7 @@ class MpiCommunicator #else return false; #endif }; } static int GetRank(CommunicationGroup group) { Loading @@ -164,7 +164,7 @@ class MpiCommunicator #else return 1; #endif }; } static int GetSize(CommunicationGroup group) { Loading @@ -176,7 +176,7 @@ class MpiCommunicator #else return 1; #endif }; } //dim-number of dimesions, distr array of guess distr - 0 for computation //distr array will be filled by computed distribution Loading @@ -201,7 +201,7 @@ class MpiCommunicator MPI_Dims_create(nproc, dim, distr); #endif }; } static void Barrier(CommunicationGroup comm) { Loading @@ -211,7 +211,7 @@ class MpiCommunicator #else throw Exceptions::MPISupportMissing(); #endif }; } template <typename T> static Request ISend( const T *data, int count, int dest, CommunicationGroup group) Loading Loading @@ -247,7 +247,7 @@ class MpiCommunicator #else throw Exceptions::MPISupportMissing(); #endif }; } template< typename T > static void Bcast( T& data, int count, int root,CommunicationGroup group) Loading @@ -272,7 +272,7 @@ class MpiCommunicator #else throw Exceptions::MPISupportMissing(); #endif }; } template< typename T > Loading @@ -288,7 +288,7 @@ class MpiCommunicator #else throw Exceptions::MPISupportMissing(); #endif }; } static void writeProlog( Logger& logger ) Loading
src/TNL/Communicators/NoDistrCommunicator.h +8 −8 Original line number Diff line number Diff line Loading @@ -53,22 +53,22 @@ class NoDistrCommunicator static bool IsInitialized() { return true; }; } static bool isDistributed() { return false; }; } static int GetRank(CommunicationGroup group) { return 0; }; } static int GetSize(CommunicationGroup group) { return 1; }; } static void DimsCreate(int nproc, int dim, int *distr) { Loading @@ -76,7 +76,7 @@ class NoDistrCommunicator { distr[i]=1; } }; } static void Barrier(CommunicationGroup group) { Loading @@ -96,7 +96,7 @@ class NoDistrCommunicator static void WaitAll(Request *reqs, int length) { }; } template< typename T > static void Bcast( T& data, int count, int root, CommunicationGroup group) Loading @@ -111,7 +111,7 @@ class NoDistrCommunicator CommunicationGroup group ) { memcpy( ( void* ) reduced_data, ( void* ) data, count * sizeof( T ) ); }; } template< typename T > static void Reduce( T* data, Loading @@ -122,7 +122,7 @@ class NoDistrCommunicator CommunicationGroup group ) { memcpy( ( void* ) reduced_data, ( void* ) data, count * sizeof( T ) ); }; } static void writeProlog( Logger& logger ){}; }; Loading
src/Tools/tnl-lattice-init.h +30 −15 Original line number Diff line number Diff line Loading @@ -89,6 +89,10 @@ bool performExtrude( const Config::ParameterContainer& parameters, ProfilePointType aux2( rotationCos * aux1.x() - rotationSin * aux1.y(), rotationSin * aux1.x() + rotationCos * aux1.y() ); aux1 = profileCenter + aux2; if( aux1.x() >= 0 && aux1.y() >= 0 && aux1.x() <= profileMesh.getProportions().x() && aux1.y() <= profileMesh.getProportions().y() ) { profileCell.getCoordinates().x() = aux1.x() / profileMesh.getSpaceSteps().x(); profileCell.getCoordinates().y() = aux1.y() / profileMesh.getSpaceSteps().y(); profileCell.refresh(); Loading @@ -96,6 +100,7 @@ bool performExtrude( const Config::ParameterContainer& parameters, if( aux ) f( cell ) = aux; } } } if( profileOrientation == "y" ) { if( p.x() < profileMesh.getOrigin().x() || Loading @@ -114,6 +119,10 @@ bool performExtrude( const Config::ParameterContainer& parameters, ProfilePointType aux2( rotationCos * aux1.x() - rotationSin * aux1.y(), rotationSin * aux1.x() + rotationCos * aux1.y() ); aux1 = profileCenter + aux2; if( aux1.x() >= 0 && aux1.y() >= 0 && aux1.x() <= profileMesh.getProportions().x() && aux1.y() <= profileMesh.getProportions().y() ) { profileCell.getCoordinates().x() = aux1.x() / profileMesh.getSpaceSteps().x(); profileCell.getCoordinates().y() = aux1.y() / profileMesh.getSpaceSteps().y(); profileCell.refresh(); Loading @@ -121,6 +130,7 @@ bool performExtrude( const Config::ParameterContainer& parameters, if( aux ) f( cell ) = aux; } } } if( profileOrientation == "z" ) { if( p.x() < profileMesh.getOrigin().x() || Loading @@ -139,6 +149,10 @@ bool performExtrude( const Config::ParameterContainer& parameters, ProfilePointType aux2( rotationCos * aux1.x() - rotationSin * aux1.y(), rotationSin * aux1.x() + rotationCos * aux1.y() ); aux1 = profileCenter + aux2; if( aux1.x() >= 0 && aux1.y() >= 0 && aux1.x() <= profileMesh.getProportions().x() && aux1.y() <= profileMesh.getProportions().y() ) { profileCell.getCoordinates().x() = aux1.x() / profileMesh.getSpaceSteps().x(); profileCell.getCoordinates().y() = aux1.y() / profileMesh.getSpaceSteps().y(); profileCell.refresh(); Loading @@ -147,6 +161,7 @@ bool performExtrude( const Config::ParameterContainer& parameters, } } } } String outputFile = parameters.getParameter< String >( "output-file" ); if( ! f.save( outputFile ) ) { Loading