diff --git a/src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/HamiltonJacobiProblem.h b/src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/HamiltonJacobiProblem.h index a4144200028fccf124aad1730b2415fa1cd9e5ff..7f1bd4193960ba3e6bbc8f2cb1fb12f7c4e84cdf 100644 --- a/src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/HamiltonJacobiProblem.h +++ b/src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/HamiltonJacobiProblem.h @@ -25,6 +25,8 @@ #include <solvers/pde/tnlLinearSystemAssembler.h> #include <functions/tnlMeshFunction.h> +#include <TNL/Meshes/DistributedMeshes/DistributedGridIO.h> + template< typename Mesh, typename DifferentialOperator, typename BoundaryCondition, diff --git a/src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/HamiltonJacobiProblem_impl.h b/src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/HamiltonJacobiProblem_impl.h index b529b09fd7a492f046fb9990cdccc49c1d6704fc..9244b18332e40887c131fbb68cabbffe417bfef2 100644 --- a/src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/HamiltonJacobiProblem_impl.h +++ b/src/TNL/Experimental/Hamilton-Jacobi/Solvers/hamilton-jacobi/HamiltonJacobiProblem_impl.h @@ -121,13 +121,25 @@ setInitialCondition( const Config::ParameterContainer& parameters, DofVectorType& dofs, MeshDependentDataType& meshDependentData ) { - this->bindDofs( mesh, dofs ); - const String& initialConditionFile = parameters.getParameter< String >( "initial-condition" ); - if( ! this->solution.boundLoad( initialConditionFile ) ) - { - std::cerr << "I am not able to load the initial condition from the file " << initialConditionFile << "." <<std::endl; + this->bindDofs( mesh, dofs ); + 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 ) ) + { + std::cerr << "I am not able to load the initial condition from the file " << initialConditionFile << "." <<std::endl; return false; - } + } + } return true; }