<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=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@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:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"DejaVu Sans Mono";
panose-1:2 11 6 9 3 8 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:DengXian;}
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:DengXian;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
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="ZH-CN" link="#0563C1" vlink="#954F72" style="text-justify-trim:punctuation">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi. I have one questions.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I use DMCreateGlobalVector to creat a global vec by this
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">DM::datotv<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Vec:ptotveq<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">…<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;line-height:14.25pt;background:white">
<span lang="EN-US" style="font-family:Consolas;color:blue">call</span><span lang="EN-US" style="font-family:Consolas;color:black"> DMDACreate1d(MPI_COMM_WORLD,DM_BOUNDARY_NONE,globalnode*cdofn,</span><span lang="EN-US" style="font-family:Consolas;color:#09885A">1</span><span lang="EN-US" style="font-family:Consolas;color:black">,</span><span lang="EN-US" style="font-family:Consolas;color:#09885A">1</span><span lang="EN-US" style="font-family:Consolas;color:black">,PETSC_NULL_INTEGER,datotv,ierr)<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left;line-height:14.25pt;background:white">
<span lang="EN-US" style="font-family:Consolas;color:blue">call</span><span lang="EN-US" style="font-family:Consolas;color:black"> DMCreateGlobalVector(datotv,ptotveq,ierr)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">it gives the wrong code <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"DejaVu Sans Mono";color:#BB0000">[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------</span><span lang="EN-US" style="font-size:9.0pt;font-family:"DejaVu Sans Mono";color:#B4F919"><br>
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"DejaVu Sans Mono"">[0]PETSC ERROR: Null argument, when expecting valid pointer<br>
[0]PETSC ERROR: Null Object: Parameter # 2<br>
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.<br>
[0]PETSC ERROR: Petsc Release Version 3.8.1, unknown <br>
[0]PETSC ERROR: /mnt/NFSwork/GeHoMadrid_Petsc/EXEC/GeHoMadrid on a arch-linux2-c-debug named linux-2euo by hstarlinux Mon Nov 6 22:21:50 2017<br>
[0]PETSC ERROR: Configure options --download-fblaslapack --download-metis --download-mpich --download-mumps --download-parmetis --download-scalapack PETSC_ARCH=arch-linux2-c-debug<br>
[0]PETSC ERROR: #1 VecSetLocalToGlobalMapping() line 78 in /home/hstarlinux/work/petsc/src/vec/vec/interface/vector.c<br>
[0]PETSC ERROR: #2 DMCreateGlobalVector_DA() line 41 in /home/hstarlinux/work/petsc/src/dm/impls/da/dadist.c<br>
[0]PETSC ERROR: #3 DMCreateGlobalVector() line 844 in /home/hstarlinux/work/petsc/src/dm/interface/dm.c<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"DejaVu Sans Mono""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"DejaVu Sans Mono"">The code run well with PETSc 3.6<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"DejaVu Sans Mono""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"DejaVu Sans Mono"">I haven’t find the Fortran example code of DMCreateGlobalVector. So how to use it correctly in fortran?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"DejaVu Sans Mono""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"DejaVu Sans Mono"">Thank you.</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
</body>
</html>