Skip to content

Commit 24758f7

Browse files
authored
Merge pull request #20 from solarcalf/update_solution
Update solution
2 parents a8ed47e + 46202ca commit 24758f7

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

Poisson_Equation/headers/Dirichlet_Problem.hpp

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,52 @@ std::vector<std::vector<FP>> const DirichletProblemSolver<GridType::Regular>::so
508508
}
509509
std::cout << "General error: " << approximation_error << std::endl;
510510

511+
std::vector<std::vector<FP>> res(n + 1, std::vector<FP>(m + 1, 0));
512+
513+
for (size_t j = m / 2; j <= m; ++j)
514+
{
515+
res[0][j] = mu1(start_y + static_cast<FP>(j) * k);
516+
}
517+
for (size_t j = 0; j <= m / 2; ++j)
518+
{
519+
res[n / 2][j] = mu2(start_y + static_cast<FP>(j) * k);
520+
}
521+
for (size_t j = 0; j <= m; ++j)
522+
{
523+
res[n][j] = mu3(start_y + static_cast<FP>(j) * k);
524+
}
525+
526+
for (size_t i = n / 2 + 1; i < n; ++i)
527+
{
528+
res[i][0] = mu4(start_x + static_cast<FP>(i) * h);
529+
}
530+
for (size_t i = 1; i < n / 2; ++i)
531+
{
532+
res[i][m / 2] = mu5(start_x + static_cast<FP>(i) * h);
533+
}
534+
for (size_t i = 1; i < n; ++i)
535+
{
536+
res[i][m] = mu6(start_x + static_cast<FP>(i) * h);
537+
}
538+
539+
size_t index = 0;
540+
for (size_t j = 1; j <= m / 2; ++j)
541+
{
542+
for (size_t i = n / 2 + 1; i < n; ++i)
543+
{
544+
res[i][j] = solution[index++];
545+
}
546+
}
547+
for (size_t j = m / 2 + 1; j < m; ++j)
548+
{
549+
for (size_t i = 1; i < n; ++i)
550+
{
551+
res[i][j] = solution[index++];
552+
}
553+
}
554+
511555
// Placeholder
512-
return std::vector<std::vector<FP>>();
556+
return res;
513557
}
514558

515559

0 commit comments

Comments
 (0)