<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 13px;">
<div style=""> Hi, Petsc Team,<br>
<br>
I use DA object to create structured data array based on global vectors. Recently, I checked my code and found an array with index out of range. But the code can run without any warning or segmentation violation message. At first I thought this might be a cache
problem. But later I ran a simpler test code on another machine and it gave no error either. I did not use any periodic boundary setting.<br>
<br>
This never took place in the past from my experience, as Petsc could always detect any segmentation violation. So what's wrong with it this time? The following is the main part of my sequential test code:<br>
<br>
DACreate3d(PETSC_COMM_WORLD,DA_NONPERIODIC,DA_STENCIL_BOX,m,n,q,PETSC_DECIDE,PETSC_DECIDE,PETSC_DECIDE,1,1,PETSC_NULL,PETSC_NULL,PETSC_NULL,&da);
<br>
DACreateGlobalVector(da, &elev); <br>
VecSet(elev, 3.14159265); <br>
DAVecGetArray(da, elev, &ele);<br>
PetscPrintf(PETSC_COMM_WORLD, "ele[3][3][%D] is %4.3e\n", m+120, ele[3][3][m+120]);
<br>
DAVecRestoreArray(da, elev, &ele);<br>
VecDestroy(elev); <br>
DADestroy(daw);<br>
<br>
<br>
Thank you very much.<br>
<br>
<br>
Zhisong Li<br>
</div>
</div>
</body>
</html>