- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I use Dirichlet boundary conditions with zeros, the function executes and the results are ok. When I use Neumann boundary conditions, I invariably get this warning printed to the console when I call s_Helmholtz_2D:
MKL POISSON LIBRARY WARNING:
The problem is degenerate up to rounding errors! The approximate solution
that provides the minimal Eucledean (sic) norm of the residual will be computed...
The function call also fills the entire input/output array with -1.#IND000, except for the left boundary, which gets filled with 1.#QNAN00. I've attached my solver code below. I pass in the Laplacian (positive), and the x and y gradients of the solution. Because MKL wants the negative lap, and I have the positive lap, I negate the Bx and By boundary conditions rather than the Ax and Ay conditions, so I should get the negative solution, which I negate in the loop at the end.
Any ideas are much appreciated.
.sean
void PoissonSolve(const FloatMatrix& lap, const FloatMatrix& Gx, const FloatMatrix& Gy,
FloatMatrixPtr* ppSolution) {
IntSize2 size = lap.size;
float ax = 0, bx = size.width, ay = 0, by = size.height;
int nx = size.width - 1, ny = size.height - 1;
float q = 0;
int ipar[128];
std::vector
int stat;
s_init_Helmholtz_2D(&ax, &bx, &ay, &by, &nx, &ny, "NNNN", &q, ipar, &spar[0], &stat);
std::vector
boundaryAy(nx + 1), boundaryBy(nx + 1);
for(int row(0); row < size.height; ++row) {
boundaryAx[row] = Gx.Row(row)[0];
boundaryBx[row] = -Gx.Row(row)[size.width - 1];
}
for(int i(0); i < size.width; ++i) {
boundaryAy = Gy.Row(0);
boundaryBy = -Gy.Row(size.height - 1);
}
assert(0 == stat);
std::vector
for(int row(0); row < size.height; ++row)
memcpy(&data[row * size.width], lap.Row(row), sizeof(float) * size.width);
DFTI_DESCRIPTOR_HANDLE xHandle;
s_commit_Helmholtz_2D(&data[0], &boundaryAx[0], &boundaryAy[0], &boundaryBx[0],
&boundaryBy[0], &xHandle, ipar, &spar[0], &stat);
s_Helmholtz_2D(&data[0], &boundaryAx[0], &boundaryAy[0], &boundaryBx[0],
&boundaryBy[0], &xHandle, ipar, &spar[0], &stat);
free_Helmholtz_2D(&xHandle, ipar, &stat);
// copy the results into the solution matrix an d negate for the positive solution
FloatMatrixPtr solution(new FloatMatrix(size));
for(int row(0); row < size.height; ++row) {
memcpy(solution->Row(row), &data[row * size.width], sizeof(float) * size.width);
for(int col(0); col < size.width; ++col)
solution->Row(row)[col] *= -1;
}
*ppSolution = solution;
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sean!
Thank you for using Intel MKL!
It would be great if you can provide us with the test cases to understand your issue. It is hard to say something about the root cause of your problems looking at the code of the routine. It might be that the size of the problem is computed incorrectly, say, 1 less than it should be. It also could be that some troubles come from the loops where arrays like boundaryAx[row] are filled. As you write ++row, you are filling the arrays starting from position 1, while you provide MKL routines with arrays starting from position 0.
As for the warning, you can remove it using proper setting of ipar array: ipar[2]=0.
Thank you for pointing out the misprinting in the message!
-Sergey G
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sean!
It seems youve encountered a problem in Helmholtz solver. Could you please check if your program will work fine with ipar[256] setting instead of ipar[128]?
The meaning of ax, ay, bx, by is to describe rectangular domain x=ax (left boundary), x=bx (right boundary), y=ay (lower boundary), y=by (upper boundary). With these settings the computations will be done for the domain ax
It looks to me that your settings of the boundary derivatives are correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks,
It seems youve encountered a problem in Helmholtz solver. Could you please check if your program will work fine with ipar[256] setting instead of ipar[128]?
The meaning of ax, ay, bx, by is to describe rectangular domain x=ax (left boundary), x=bx (right boundary), y=ay (lower boundary), y=by (upper boundary). With these settings the computations will be done for the domain ax
It looks to me that your settings of the boundary derivatives are correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sean,
Sorry for the delay with the reply. It seems the system deleted my alerts for this forum thread. Could you provide us with the test case to uderstandthe root cause of theproblem?It seems that on our side everything works fine.
Kind regards,
Sergey

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page