Skip to content

Commit

Permalink
Correct merge problems
Browse files Browse the repository at this point in the history
  • Loading branch information
SLongshaw committed Aug 2, 2023
1 parent 32b6670 commit b2ebbb4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
12 changes: 6 additions & 6 deletions 09-algorithms/9-0-fixedRelaxation/9-0-1-restart/heat-left.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int main( int argc, char ** argv ) {
MPI_Comm_rank( world, &rank );
MPI_Comm_size( world, &size );

/// Create folder
/// Create rbf matrix folder
std::string makedirMString = "results_left" + std::to_string(rank);
mkdir(makedirMString.c_str(), 0777);
std::string fileAddress(makedirMString);
Expand Down Expand Up @@ -143,14 +143,14 @@ int main( int argc, char ** argv ) {
for ( int i = 0; i < 7; i++ ) outputFileLeft << i * H << "," << u[i] << ", \n";
outputFileLeft.close();

for ( int iter = 1; iter <= 1000; ++iter ) {
printf( "Left grid iteration %d\n", iter );
for ( int t = 1; t <= 1000; ++t ) {
printf( "Left grid step %d\n", t );

// push data to the other solver
interface.push( "u", 4, u[4]);
interface.commit( iter );
interface.commit( t );

u[6] = interface.fetch( "u0", 6 * H, iter, s1, s2, fr );
u[6] = interface.fetch( "u0", 6 * H, t, s1, s2, fr );


// calculate 'interior' points
Expand All @@ -165,7 +165,7 @@ int main( int argc, char ** argv ) {
/// Output
std::ofstream outputFileLeft;
std::string filenameL = "results_left" + std::to_string(rank) + "/solution-left_FR_"
+ std::to_string(iter) + ".csv";
+ std::to_string(t) + ".csv";
outputFileLeft.open(filenameL);
outputFileLeft << "\"X\",\"u\"\n";
for ( int i = 0; i < 7; i++ ) outputFileLeft << i * H << "," << u[i] << ", \n";
Expand Down
12 changes: 6 additions & 6 deletions 09-algorithms/9-0-fixedRelaxation/9-0-1-restart/heat-right.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int main( int argc, char ** argv ) {
MPI_Comm_rank( world, &rank );
MPI_Comm_size( world, &size );

/// Create folder
/// Create rbf matrix folder
std::string makedirMString = "results_right" + std::to_string(rank);
mkdir(makedirMString.c_str(), 0777);
std::string fileAddress(makedirMString);
Expand Down Expand Up @@ -141,10 +141,10 @@ int main( int argc, char ** argv ) {
for ( int i = 4; i < 11; i++ ) outputFileRight << i * H << "," << u[i] << ", \n";
outputFileRight.close();

for ( int iter = 1; iter <= 1000; ++iter ) {
printf( "Right grid iteration %d\n", iter );
for ( int t = 1; t <= 1000; ++t ) {
printf( "Right grid step %d\n", t );

u[4] = interface.fetch( "u", 4 * H, iter, s1, s2, fr );
u[4] = interface.fetch( "u", 4 * H, t, s1, s2, fr );

// calculate 'interior' points
for ( int i = 5; i < 11; i++ ) v[i] = u[i] + k / ( H * H ) * ( u[i - 1] + u[i + 1] - 2 * u[i] );
Expand All @@ -154,14 +154,14 @@ int main( int argc, char ** argv ) {

// push data to the other solver
interface.push( "u0", 6 * H, u[6] );
interface.commit( iter );
interface.commit( t );
// I/O
std::swap( u, v );

/// Output
std::ofstream outputFileRight;
std::string filenameR = "results_right" + std::to_string(rank) + "/solution-right_FR_0"
+ std::to_string(iter) + ".csv";
+ std::to_string(t) + ".csv";
outputFileRight.open(filenameR);
outputFileRight << "\"X\",\"u\"\n";
for ( int i = 4; i < 11; i++ ) outputFileRight << i * H << "," << u[i] << ", \n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int main( int argc, char ** argv ) {
MPI_Comm_rank( world, &rank );
MPI_Comm_size( world, &size );

/// Create folder
/// Create rbf matrix folder
std::string makedirMString = "results_left" + std::to_string(rank);
mkdir(makedirMString.c_str(), 0777);
std::string fileAddress(makedirMString);
Expand Down Expand Up @@ -143,17 +143,17 @@ int main( int argc, char ** argv ) {
for ( int i = 0; i < 70; i+=10 ) outputFileLeft << i * H << "," << u[i] << ", \n";
outputFileLeft.close();

for ( int iter = 1; iter <= 1000; ++iter ) {
printf( "Left grid iteration %d\n", iter );
for ( int t = 1; t <= 1000; ++t ) {
printf( "Left grid step %d\n", t );

// push data to the other solver
interface.push( "u", 40, u[40]);
interface.commit( iter );
interface.commit( t );

u[60] = interface.fetch( "u0", 60 * H, iter, s1, s2, fr );
u[60] = interface.fetch( "u0", 60 * H, t, s1, s2, fr );

if ((iter>=150) && (iter<250)) {
u[58] = interface.fetch( "u0", 58 * H, iter, s1, s2, fr );
if ((t>=150) && (t<250)) {
u[58] = interface.fetch( "u0", 58 * H, t, s1, s2, fr );
}

// calculate 'interior' points
Expand All @@ -163,7 +163,7 @@ int main( int argc, char ** argv ) {

v[N - 10] = u[N - 10];

if ((iter>=150) && (iter<250)) {
if ((t>=150) && (t<250)) {
v[58] = u[58];
}

Expand All @@ -172,13 +172,13 @@ int main( int argc, char ** argv ) {
/// Output
std::ofstream outputFileLeft;
std::string filenameL = "results_left" + std::to_string(rank) + "/solution-left_FR_"
+ std::to_string(iter) + ".csv";
+ std::to_string(t) + ".csv";
outputFileLeft.open(filenameL);
outputFileLeft << "\"X\",\"u\"\n";

for ( int i = 0; i < 60; i+=10 ) outputFileLeft << i * H << "," << u[i] << ", \n";

if ((iter>=150) && (iter<250)) {
if ((t>=150) && (t<250)) {
outputFileLeft << 58 * H << "," << u[58] << ", \n";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int main( int argc, char ** argv ) {
MPI_Comm_rank( world, &rank );
MPI_Comm_size( world, &size );

/// Create folder
/// Create rbf matrix folder
std::string makedirMString = "results_right" + std::to_string(rank);
mkdir(makedirMString.c_str(), 0777);
std::string fileAddress(makedirMString);
Expand Down Expand Up @@ -141,13 +141,13 @@ int main( int argc, char ** argv ) {
for ( int i = 40; i < 110; i+=10 ) outputFileRight << i * H << "," << u[i] << ", \n";
outputFileRight.close();

for ( int iter = 1; iter <= 1000; ++iter ) {
printf( "Right grid iteration %d\n", iter );
for ( int t = 1; t <= 1000; ++t ) {
printf( "Right grid step %d\n", t );

u[40] = interface.fetch( "u", 40 * H, iter, s1, s2, fr );
u[40] = interface.fetch( "u", 40 * H, t, s1, s2, fr );

if ((iter>=100) && (iter<200)) {
u[42] = interface.fetch( "u", 42 * H, iter, s1, s2, fr );
if ((t>=100) && (t<200)) {
u[42] = interface.fetch( "u", 42 * H, t, s1, s2, fr );
}

// calculate 'interior' points
Expand All @@ -156,26 +156,26 @@ int main( int argc, char ** argv ) {
v[N - 10] = 0.0;
v[40] = u[40 ];

if ((iter>=100) && (iter<200)) {
if ((t>=100) && (t<200)) {
v[42] = u[42 ];
}

// push data to the other solver
interface.push( "u0", 60 * H, u[60] );
interface.commit( iter );
interface.commit( t );
// I/O
std::swap( u, v );

/// Output
std::ofstream outputFileRight;
std::string filenameR = "results_right" + std::to_string(rank) + "/solution-right_FR_0"
+ std::to_string(iter) + ".csv";
+ std::to_string(t) + ".csv";
outputFileRight.open(filenameR);
outputFileRight << "\"X\",\"u\"\n";

outputFileRight << 40 * H << "," << u[40] << ", \n";

if ((iter>=100) && (iter<200)) {
if ((t>=100) && (t<200)) {
outputFileRight << 42 * H << "," << u[42] << ", \n";
}

Expand Down

0 comments on commit b2ebbb4

Please sign in to comment.