<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><blockquote type="cite" class="">complex version is needed since matrix sometimes is real and sometimes is complex. </blockquote>PetscScalar is a flexible datatype, it will be real if PETSc is configured without complex support and include complex if PETSc is configured with complex. <div class=""><br class=""><div class=""><blockquote type="cite" class=""> I want to solve real matrix without allocating memory for imaginary part((except eigen pairs).</blockquote></div><div class="">If you only want to use the real component of a PetscScalar you can use PetscRealPart() <a href="https://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Sys/PetscRealPart.html" class="">https://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Sys/PetscRealPart.html</a> to extract it. <div class=""><br class=""><div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div>Best regards,<br class=""><br class="">Jacob Faibussowitsch<br class="">(Jacob Fai - booss - oh - vitch)<br class="">Cell: (312) 694-3391</div></div>
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On May 26, 2020, at 3:28 PM, Sam Guo <<a href="mailto:sam.guo@cd-adapco.com" class="">sam.guo@cd-adapco.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">complex version is needed since matrix sometimes is real and sometimes is complex. I want to solve real matrix without allocating memory for imaginary part((except eigen pairs).<br class=""><br class="">On Tuesday, May 26, 2020, Zhang, Hong <<a href="mailto:hzhang@mcs.anl.gov" class="">hzhang@mcs.anl.gov</a>> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr" class="">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
You can build PETSc with complex <span style="color:rgb(50,49,48);font-family:"Segoe UI","Segoe UI Web (West European)","Segoe UI",-apple-system,system-ui,Roboto,"Helvetica Neue",sans-serif;background-color:rgb(255,255,255);display:inline!important" class="">
version</span>, and declare some variables as 'PETSC_REAL'.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
Hong</div>
<div class=""></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<br class="">
</div>
<hr style="display:inline-block;width:98%" class="">
<div dir="ltr" class=""><font face="Calibri, sans-serif" style="font-size:11pt" class=""><b class="">From:</b> petsc-users <<a href="mailto:petsc-users-bounces@mcs.anl.gov" target="_blank" class="">petsc-users-bounces@mcs.anl.<wbr class="">gov</a>> on behalf of Sam Guo <<a href="mailto:sam.guo@cd-adapco.com" target="_blank" class="">sam.guo@cd-adapco.com</a>><br class="">
<b class="">Sent:</b> Tuesday, May 26, 2020 1:00 PM<br class="">
<b class="">To:</b> PETSc <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank" class="">petsc-users@mcs.anl.gov</a>><br class="">
<b class="">Subject:</b> [petsc-users] using real and complex together</font>
<div class=""> </div>
</div>
<div class="">
<div dir="ltr" class="">Dear PETSc dev team,
<div class=""> Can I use both real and complex versions together?</div>
<div class=""><br class="">
</div>
<div class="">Thanks,</div>
<div class="">Sam</div>
</div>
</div>
</div>
</blockquote>
</div></blockquote></div><br class=""></div></div></div></body></html>