Skip to content
Snippets Groups Projects
Commit 501922cd authored by wenqing's avatar wenqing
Browse files

Minor changes according to the comments by Nori

parent 20a18de8
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,11 @@ PETScLinearSolver::PETScLinearSolver(PETScMatrix &A, const std::string &prefix)
KSPGetPC(_solver, &_pc);
//
KSPSetOptionsPrefix(_solver, prefix.c_str());
if ( !prefix.empty() )
{
KSPSetOptionsPrefix(_solver, prefix.c_str());
}
KSPSetFromOptions(_solver); // set running time option
}
......
......@@ -27,6 +27,13 @@
TEST(FileIO, TestBoostXmlCndInterfaceUsingBoundaryCondition)
{
#if defined(USE_PETSC) || defined(USE_MPI)
int mrank;
MPI_Comm_rank(PETSC_COMM_WORLD, &mrank);
if(mrank == 0)
{
#endif
// setup test data
std::string geometry_name("GeometryForBC");
const std::string bc_pnt_name("bc_pnt");
......@@ -116,4 +123,8 @@ TEST(FileIO, TestBoostXmlCndInterfaceUsingBoundaryCondition)
conds[1]->getProcessDistributionType());
ASSERT_EQ(conds[0]->getDisValues().size(), conds[1]->getDisValues().size());
ASSERT_NEAR(conds[0]->getDisValues()[0], conds[1]->getDisValues()[0], std::numeric_limits<double>::epsilon());
#if defined(USE_PETSC) || defined(USE_MPI)
}
#endif
}
......@@ -26,10 +26,16 @@
// GeoLib
#include "Polyline.h"
TEST(FileIO, XmlGmlWriterReaderTest)
{
// Writer test
#if defined(USE_PETSC) || defined(USE_MPI)
int mrank;
MPI_Comm_rank(PETSC_COMM_WORLD, &mrank);
if(mrank == 0)
{
#endif
// Writer test
std::string test_data_file(std::string(SOURCEPATH).append("/Tests/FileIO/xmlgmltestdata.gml"));
ProjectData project;
......@@ -121,4 +127,10 @@ TEST(FileIO, XmlGmlWriterReaderTest)
boost::filesystem::remove(test_data_file);
test_data_file += ".md5";
boost::filesystem::remove(test_data_file);
#if defined(USE_PETSC) || defined(USE_MPI)
}
#endif
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment