Loading src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/HamiltonJacobiProblem.h +0 −2 Original line number Original line Diff line number Diff line Loading @@ -25,8 +25,6 @@ #include <solvers/pde/tnlLinearSystemAssembler.h> #include <solvers/pde/tnlLinearSystemAssembler.h> #include <functions/tnlMeshFunction.h> #include <functions/tnlMeshFunction.h> #include <TNL/Meshes/DistributedMeshes/DistributedGridIO.h> template< typename Mesh, template< typename Mesh, typename DifferentialOperator, typename DifferentialOperator, typename BoundaryCondition, typename BoundaryCondition, Loading src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/HamiltonJacobiProblem_impl.h +4 −16 Original line number Original line Diff line number Diff line Loading @@ -123,23 +123,11 @@ setInitialCondition( const Config::ParameterContainer& parameters, { { this->bindDofs( mesh, dofs ); this->bindDofs( mesh, dofs ); const String& initialConditionFile = parameters.getParameter< String >( "initial-condition" ); const String& initialConditionFile = parameters.getParameter< String >( "initial-condition" ); if(CommunicatorType::isDistributed()) { std::cout<<"Nodes Distribution: " << uPointer->getMesh().getDistributedMesh()->printProcessDistr() << std::endl; if(distributedIOType==Meshes::DistributedMeshes::MpiIO) Meshes::DistributedMeshes::DistributedGridIO<MeshFunctionType,Meshes::DistributedMeshes::MpiIO> ::load(initialConditionFile, *uPointer ); if(distributedIOType==Meshes::DistributedMeshes::LocalCopy) Meshes::DistributedMeshes::DistributedGridIO<MeshFunctionType,Meshes::DistributedMeshes::LocalCopy> ::load(initialConditionFile, *uPointer ); uPointer->template synchronize<CommunicatorType>(); } else { if( ! this->solution.boundLoad( initialConditionFile ) ) if( ! this->solution.boundLoad( initialConditionFile ) ) { { std::cerr << "I am not able to load the initial condition from the file " << initialConditionFile << "." <<std::endl; std::cerr << "I am not able to load the initial condition from the file " << initialConditionFile << "." <<std::endl; return false; return false; } } } return true; return true; } } Loading src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/tnlDirectEikonalMethodsBase_impl.h +3 −3 Original line number Original line Diff line number Diff line Loading @@ -99,7 +99,7 @@ tnlDirectEikonalMethodsBase< Meshes::Grid< 2, Real, Device, Index > >:: updateBlocks( InterfaceMapType interfaceMap, updateBlocks( InterfaceMapType interfaceMap, MeshFunctionType aux, MeshFunctionType aux, MeshFunctionType helpFunc, MeshFunctionType helpFunc, ArrayContainer BlockIterHost, IndexType numThreadsPerBlock/*, Real **sArray*/ ) ArrayContainer BlockIterHost, int numThreadsPerBlock/*, Real **sArray*/ ) { { #pragma omp parallel for schedule( dynamic ) #pragma omp parallel for schedule( dynamic ) for( IndexType i = 0; i < BlockIterHost.getSize(); i++ ) for( IndexType i = 0; i < BlockIterHost.getSize(); i++ ) Loading Loading @@ -267,13 +267,13 @@ updateBlocks( InterfaceMapType interfaceMap, template< typename Real, template< typename Real, typename Device, typename Device, typename Index > typename Index > template< IndexType sizeSArray > template< int sizeSArray > void void tnlDirectEikonalMethodsBase< Meshes::Grid< 3, Real, Device, Index > >:: tnlDirectEikonalMethodsBase< Meshes::Grid< 3, Real, Device, Index > >:: updateBlocks( const InterfaceMapType interfaceMap, updateBlocks( const InterfaceMapType interfaceMap, const MeshFunctionType aux, const MeshFunctionType aux, MeshFunctionType& helpFunc, MeshFunctionType& helpFunc, ArrayContainer BlockIterHost, IndexType numThreadsPerBlock/*, Real **sArray*/ ) ArrayContainer BlockIterHost, int numThreadsPerBlock/*, Real **sArray*/ ) { { //#pragma omp parallel for schedule( dynamic ) //#pragma omp parallel for schedule( dynamic ) for( IndexType i = 0; i < BlockIterHost.getSize(); i++ ) for( IndexType i = 0; i < BlockIterHost.getSize(); i++ ) Loading src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/tnlDirectEikonalProblem.h +7 −1 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,8 @@ #include <TNL/Pointers/SharedPointer.h> #include <TNL/Pointers/SharedPointer.h> #include "tnlFastSweepingMethod.h" #include "tnlFastSweepingMethod.h" #include <TNL/Meshes/DistributedMeshes/DistributedGridIO.h> template< typename Mesh, template< typename Mesh, typename Communicator, typename Communicator, typename Anisotropy, typename Anisotropy, Loading Loading @@ -46,6 +48,8 @@ class tnlDirectEikonalProblem using MeshPointer = Pointers::SharedPointer< MeshType >; using MeshPointer = Pointers::SharedPointer< MeshType >; using DofVectorPointer = Pointers::SharedPointer< DofVectorType >; using DofVectorPointer = Pointers::SharedPointer< DofVectorType >; typedef Communicator CommunicatorType; static constexpr bool isTimeDependent() { return false; }; static constexpr bool isTimeDependent() { return false; }; static String getType(); static String getType(); Loading Loading @@ -79,6 +83,8 @@ class tnlDirectEikonalProblem AnisotropyPointer anisotropy; AnisotropyPointer anisotropy; Meshes::DistributedMeshes::DistrGridIOTypes distributedIOType; }; }; #include "tnlDirectEikonalProblem_impl.h" #include "tnlDirectEikonalProblem_impl.h" src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/tnlDirectEikonalProblem_impl.h +20 −5 Original line number Original line Diff line number Diff line Loading @@ -113,10 +113,25 @@ tnlDirectEikonalProblem< Mesh, Communicator, Anisotropy, Real, Index >:: setInitialCondition( const Config::ParameterContainer& parameters, setInitialCondition( const Config::ParameterContainer& parameters, DofVectorPointer& dofs ) DofVectorPointer& dofs ) { { this->bindDofs( dofs ); String inputFile = parameters.getParameter< String >( "input-file" ); String inputFile = parameters.getParameter< String >( "input-file" ); this->initialData->setMesh( this->getMesh() ); this->initialData->setMesh( this->getMesh() ); std::cout<<"setInitialCondition" <<std::endl; if(CommunicatorType::isDistributed()) { std::cout<<"Nodes Distribution: " << u->getMesh().getDistributedMesh()->printProcessDistr() << std::endl; if(distributedIOType==Meshes::DistributedMeshes::MpiIO) Meshes::DistributedMeshes::DistributedGridIO<MeshFunctionType,Meshes::DistributedMeshes::MpiIO> ::load(inputFile, *u ); if(distributedIOType==Meshes::DistributedMeshes::LocalCopy) Meshes::DistributedMeshes::DistributedGridIO<MeshFunctionType,Meshes::DistributedMeshes::LocalCopy> ::load(inputFile, *u ); u->template synchronize<CommunicatorType>(); } else { if( !this->initialData->boundLoad( inputFile ) ) if( !this->initialData->boundLoad( inputFile ) ) std::cerr << "I am not able to load the initial condition from the file " << inputFile << "." << std::endl; return false; return false; } return true; return true; } } Loading Loading
src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/HamiltonJacobiProblem.h +0 −2 Original line number Original line Diff line number Diff line Loading @@ -25,8 +25,6 @@ #include <solvers/pde/tnlLinearSystemAssembler.h> #include <solvers/pde/tnlLinearSystemAssembler.h> #include <functions/tnlMeshFunction.h> #include <functions/tnlMeshFunction.h> #include <TNL/Meshes/DistributedMeshes/DistributedGridIO.h> template< typename Mesh, template< typename Mesh, typename DifferentialOperator, typename DifferentialOperator, typename BoundaryCondition, typename BoundaryCondition, Loading
src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/HamiltonJacobiProblem_impl.h +4 −16 Original line number Original line Diff line number Diff line Loading @@ -123,23 +123,11 @@ setInitialCondition( const Config::ParameterContainer& parameters, { { this->bindDofs( mesh, dofs ); this->bindDofs( mesh, dofs ); const String& initialConditionFile = parameters.getParameter< String >( "initial-condition" ); const String& initialConditionFile = parameters.getParameter< String >( "initial-condition" ); if(CommunicatorType::isDistributed()) { std::cout<<"Nodes Distribution: " << uPointer->getMesh().getDistributedMesh()->printProcessDistr() << std::endl; if(distributedIOType==Meshes::DistributedMeshes::MpiIO) Meshes::DistributedMeshes::DistributedGridIO<MeshFunctionType,Meshes::DistributedMeshes::MpiIO> ::load(initialConditionFile, *uPointer ); if(distributedIOType==Meshes::DistributedMeshes::LocalCopy) Meshes::DistributedMeshes::DistributedGridIO<MeshFunctionType,Meshes::DistributedMeshes::LocalCopy> ::load(initialConditionFile, *uPointer ); uPointer->template synchronize<CommunicatorType>(); } else { if( ! this->solution.boundLoad( initialConditionFile ) ) if( ! this->solution.boundLoad( initialConditionFile ) ) { { std::cerr << "I am not able to load the initial condition from the file " << initialConditionFile << "." <<std::endl; std::cerr << "I am not able to load the initial condition from the file " << initialConditionFile << "." <<std::endl; return false; return false; } } } return true; return true; } } Loading
src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/tnlDirectEikonalMethodsBase_impl.h +3 −3 Original line number Original line Diff line number Diff line Loading @@ -99,7 +99,7 @@ tnlDirectEikonalMethodsBase< Meshes::Grid< 2, Real, Device, Index > >:: updateBlocks( InterfaceMapType interfaceMap, updateBlocks( InterfaceMapType interfaceMap, MeshFunctionType aux, MeshFunctionType aux, MeshFunctionType helpFunc, MeshFunctionType helpFunc, ArrayContainer BlockIterHost, IndexType numThreadsPerBlock/*, Real **sArray*/ ) ArrayContainer BlockIterHost, int numThreadsPerBlock/*, Real **sArray*/ ) { { #pragma omp parallel for schedule( dynamic ) #pragma omp parallel for schedule( dynamic ) for( IndexType i = 0; i < BlockIterHost.getSize(); i++ ) for( IndexType i = 0; i < BlockIterHost.getSize(); i++ ) Loading Loading @@ -267,13 +267,13 @@ updateBlocks( InterfaceMapType interfaceMap, template< typename Real, template< typename Real, typename Device, typename Device, typename Index > typename Index > template< IndexType sizeSArray > template< int sizeSArray > void void tnlDirectEikonalMethodsBase< Meshes::Grid< 3, Real, Device, Index > >:: tnlDirectEikonalMethodsBase< Meshes::Grid< 3, Real, Device, Index > >:: updateBlocks( const InterfaceMapType interfaceMap, updateBlocks( const InterfaceMapType interfaceMap, const MeshFunctionType aux, const MeshFunctionType aux, MeshFunctionType& helpFunc, MeshFunctionType& helpFunc, ArrayContainer BlockIterHost, IndexType numThreadsPerBlock/*, Real **sArray*/ ) ArrayContainer BlockIterHost, int numThreadsPerBlock/*, Real **sArray*/ ) { { //#pragma omp parallel for schedule( dynamic ) //#pragma omp parallel for schedule( dynamic ) for( IndexType i = 0; i < BlockIterHost.getSize(); i++ ) for( IndexType i = 0; i < BlockIterHost.getSize(); i++ ) Loading
src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/tnlDirectEikonalProblem.h +7 −1 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,8 @@ #include <TNL/Pointers/SharedPointer.h> #include <TNL/Pointers/SharedPointer.h> #include "tnlFastSweepingMethod.h" #include "tnlFastSweepingMethod.h" #include <TNL/Meshes/DistributedMeshes/DistributedGridIO.h> template< typename Mesh, template< typename Mesh, typename Communicator, typename Communicator, typename Anisotropy, typename Anisotropy, Loading Loading @@ -46,6 +48,8 @@ class tnlDirectEikonalProblem using MeshPointer = Pointers::SharedPointer< MeshType >; using MeshPointer = Pointers::SharedPointer< MeshType >; using DofVectorPointer = Pointers::SharedPointer< DofVectorType >; using DofVectorPointer = Pointers::SharedPointer< DofVectorType >; typedef Communicator CommunicatorType; static constexpr bool isTimeDependent() { return false; }; static constexpr bool isTimeDependent() { return false; }; static String getType(); static String getType(); Loading Loading @@ -79,6 +83,8 @@ class tnlDirectEikonalProblem AnisotropyPointer anisotropy; AnisotropyPointer anisotropy; Meshes::DistributedMeshes::DistrGridIOTypes distributedIOType; }; }; #include "tnlDirectEikonalProblem_impl.h" #include "tnlDirectEikonalProblem_impl.h"
src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/tnlDirectEikonalProblem_impl.h +20 −5 Original line number Original line Diff line number Diff line Loading @@ -113,10 +113,25 @@ tnlDirectEikonalProblem< Mesh, Communicator, Anisotropy, Real, Index >:: setInitialCondition( const Config::ParameterContainer& parameters, setInitialCondition( const Config::ParameterContainer& parameters, DofVectorPointer& dofs ) DofVectorPointer& dofs ) { { this->bindDofs( dofs ); String inputFile = parameters.getParameter< String >( "input-file" ); String inputFile = parameters.getParameter< String >( "input-file" ); this->initialData->setMesh( this->getMesh() ); this->initialData->setMesh( this->getMesh() ); std::cout<<"setInitialCondition" <<std::endl; if(CommunicatorType::isDistributed()) { std::cout<<"Nodes Distribution: " << u->getMesh().getDistributedMesh()->printProcessDistr() << std::endl; if(distributedIOType==Meshes::DistributedMeshes::MpiIO) Meshes::DistributedMeshes::DistributedGridIO<MeshFunctionType,Meshes::DistributedMeshes::MpiIO> ::load(inputFile, *u ); if(distributedIOType==Meshes::DistributedMeshes::LocalCopy) Meshes::DistributedMeshes::DistributedGridIO<MeshFunctionType,Meshes::DistributedMeshes::LocalCopy> ::load(inputFile, *u ); u->template synchronize<CommunicatorType>(); } else { if( !this->initialData->boundLoad( inputFile ) ) if( !this->initialData->boundLoad( inputFile ) ) std::cerr << "I am not able to load the initial condition from the file " << inputFile << "." << std::endl; return false; return false; } return true; return true; } } Loading