<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE-CH" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi All,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-GB">I am having the following error when I try to do a mapping with vectors and I can’t figure out how to solve this or what is going wrong:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%">error: invalid types ‘PetscScalar* {aka double*}[PetscScalar {aka double}]’ for array subscript<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> xpMMA[i] = xp[indicesMap[i]];<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Herewith two code snippets:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> // total number of elements on core<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%">
</span><span lang="IT" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%">PetscInt nel;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="IT" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> VecGetLocalSize(xPhys, &nel);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="IT" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="IT" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> // create xPassive vector<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="IT" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> ierr = VecDuplicate(xPhys, &xPassive);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="IT" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> CHKERRQ(ierr);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="IT" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="IT" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%">
</span><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%">// create mapping vector<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> ierr = VecDuplicate(xPhys, &indicator);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> CHKERRQ(ierr);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> // index set for xPassive and indicator<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> PetscScalar *xpPassive, *xpIndicator;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> ierr = VecGetArray(xPassive, &xpPassive);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> CHKERRQ(ierr);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> ierr = VecGetArray(indicator, &xpIndicator);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> CHKERRQ(ierr);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> // counters for total and active elements on this processor<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> PetscInt tcount = 0; // total number of elements<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> PetscInt acount = 0; // number of active elements<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> PetscInt scount = 0; // number of solid elements<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> PetscInt rcount = 0; // number of rigid element<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> // loop over all elements and update xPassive from wrapper data<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> // count number of active elements, acount<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> // set indicator vector<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> for (PetscInt el = 0; el < nel; el++) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> if (data.xPassive_w.size() > 1) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> xpPassive[el] = data.xPassive_w[el];<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> tcount++;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> if (xpPassive[el] < 0) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> xpIndicator[acount] =
</span><span lang="EN-GB">el;<span style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> acount++;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> }
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> } else {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> xpPassive[el] = -1.0; // default, if no xPassive_w than all elements are active = -1.0<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> // printing<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> //PetscPrintf(PETSC_COMM_WORLD, "tcount: %i\n", tcount);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> //PetscPrintf(PETSC_COMM_WORLD, "acount: %i\n", acount);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> // Allreduce, get number of active elements over all processes<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> // tmp number of var on proces<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> // acount total number of var sumed<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> PetscInt tmp = acount;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> acount = 0.0;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> MPI_Allreduce(&tmp, &(acount), 1, MPIU_INT, MPI_SUM, PETSC_COMM_WORLD);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%"> //// create xMMA vector<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#1F4E79;mso-style-textfill-fill-color:#1F4E79;mso-style-textfill-fill-alpha:100.0%">VecCreateMPI(PETSC_COMM_WORLD, tmp, acount, &xMMA);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> // Pointers to the vectors<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> PetscScalar *xp, *xpMMA, *indicesMap;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> //PetscInt indicesMap;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> ierr = VecGetArray(MMAVector, &xpMMA);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> CHKERRQ(ierr);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> ierr = VecGetArray(elementVector, &xp);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> CHKERRQ(ierr);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> // Index set<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> PetscInt nLocalVar;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> VecGetLocalSize(xMMA, &nLocalVar);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> // print number of var on pocessor<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> PetscPrintf(PETSC_COMM_WORLD, "Local var: %i\n", nLocalVar);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> ierr = VecGetArray(indicator,
</span><span lang="EN-GB">&indicesMap<span style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%">);<o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> CHKERRQ(ierr);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> // Run through the indices<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> for (PetscInt i = 0; i < nLocalVar; i++) {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> if (updateDirection > 0) {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> //PetscPrintf(PETSC_COMM_WORLD, "i: %i, xp[%i] = %f\n", i, indicesMap[i], xp[indicesMap[i]]);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> xpMMA[i] = xp[indicesMap[i]];<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> } else if (updateDirection < 0) {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> xp[indicesMap[i]] = xpMMA[i];<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> //PetscPrintf(PETSC_COMM_WORLD, "i: %i, xp[%i] = %f\n", i, indicesMap[i], xp[indicesMap[i]]);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> // Restore<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> ierr = VecRestoreArray(elementVector, &xp);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> CHKERRQ(ierr);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> ierr = VecRestoreArray(MMAVector, &xpMMA);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> CHKERRQ(ierr);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> ierr = VecRestoreArray(indicator, &indicesMap);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> CHKERRQ(ierr);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"> PetscPrintf(PETSC_COMM_WORLD, "FINISHED UpdateVariables \n");<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#843C0C;mso-style-textfill-fill-color:#843C0C;mso-style-textfill-fill-alpha:100.0%"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">The error message says that the type with which I try to index is wrong, I think. But VecGetArray only excepts scalars. Furthermore, the el variable is an int, but is seams like to turn out to be a scalar. Does anybody
see how to proceed with this? <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#24292E">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#24292E"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#24292E">Thijs Smit<o:p></o:p></span></p>
</div>
</body>
</html>