Hi, All.

I’ve made 2D Laplace Equation solver using OF & C++.

Laplace Equation: https://en.wikipedia.org/wiki/Laplace’s_equation

But it shows this strange result.

May be, because of Final Image Normalization problem …

What’s wrong to me?

My Code is …

```
void ofApp::setup(){
aa.setImageType(OF_IMAGE_COLOR);
cv::Mat data = cv::Mat(52, 52, CV_8UC3);
// 2d Mat initialize ------------
for(int i=0;i<52;i++) {
for (int j=0;j<52;j++) {
data.at<Vec3b>(i, j)[0] = 0;
data.at<Vec3b>(i, j)[1] = 0;
data.at<Vec3b>(i, j)[2] = 0;
}
}
// Initial Boundary condition -----------
for(int i=0;i<52;i++) {
for (int j=0;j<52;j++) {
data.at<Vec3b>(0, j)[0] = 0;
data.at<Vec3b>(0, j)[1] = 0;
data.at<Vec3b>(0, j)[2] = 0;
data.at<Vec3b>(51, j)[0] = 0;
data.at<Vec3b>(51, j)[1] = 255;
data.at<Vec3b>(51, j)[2] = 0;
data.at<Vec3b>(i, 0)[0] = 0;
data.at<Vec3b>(i, 0)[1] = 255;
data.at<Vec3b>(i, 0)[2] = 0;
data.at<Vec3b>(i, 51)[0] = 0;
data.at<Vec3b>(i, 51)[1] = 0;
data.at<Vec3b>(i, 51)[2] = 0;
}
}//for
// numerical analysis parameters -----
goal= 0.0005;
error= 999999.99;
float temp_error;
float dmax;
// iteration difference equation for Laplace equation solve
// this loop has no prolem in mathmatical logics
while(error > goal){
error=0.0;
for(int i=0; i<52; i++){
for(int j=0; j<52; j++){
temp_error= data.at<Vec3b>(i, j)[1];
data.at<Vec3b>(i, j)[1]= (data.at<Vec3b>(i-1,j)[1] + data.at<Vec3b>(i+1, j)[1] +
data.at<Vec3b>(i, j+1)[1] +
data.at<Vec3b>(i, j-1)[1])/4.0;
error += abs(temp_error-data.at<Vec3b>(i, j)[1]);
}//if
}//for
}//for
}// while
toOf(data, aa); // error happens at here, may be ..
aa.update();
}
```

and error message is here.

```
[ error ] ofImage: getBmpFromPixels(): unable to get FIBITMAP from ofPixels
[ error ] ofImage: putBmpIntoPixels(): unable to set ofPixels from FIBITMAP
2020-09-14 19:26:40.058420+0900 laplaceEqDebug[16519:2167521] Metal API Validation Enabled
```

Thanks.

Best,

@bemoregt.