<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hello Frederico,<div class="">I’m not sure that’s possible.</div><div class="">Here is what I do, it makes me sick, but mixing precisions/scalar types with PETSc is difficult (crossing my fingers this will be better with future).</div><div class="">In MATLAB (after putting petsc/share/petsc/matlab in the path):</div><div class="">A = PetscBinaryRead('your_binary_mat_with_re+im.dat','complex',true); % scalar-type=complex</div><div class="">PetscBinaryWrite('re.dat',real(A)); % scalar-type=real</div><div class="">PetscBinaryWrite('im.dat',imag(A)); % scalar-type=real</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Pierre</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 11 May 2021, at 3:30 PM, Frederico Teixeira <<a href="mailto:teixeira@zmt.swiss" class="">teixeira@zmt.swiss</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;" class=""><div data-marker="__QUOTED_TEXT__" class=""><div style="" data-mce-style="font-family: 'arial' , 'helvetica' , sans-serif; font-size: 12pt; color: #000000;" class=""><div class=""><div class="">Dear fellows,<br class=""></div></div></div></div><div data-marker="__QUOTED_TEXT__" class=""><div style="font-family: arial, helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial;" data-mce-style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" class=""><div class=""><br class=""></div><div class="">I hope this message finds you safe and well.</div><div class=""><br class=""></div><div class="">I have<span data-mce-style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;" style="font-family: arial, helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; float: none; display: inline !important;" class=""> </span><span data-mce-style="font-size: 12pt;" style="font-size: 12pt;" class="">a complex-valued matrix and its real/imaginary components<span class=""> </span><span data-mce-style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;" style="font-family: arial, helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; float: none; display: inline !important;" class="">in </span><span data-mce-style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;" style="font-family: arial, helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; background-color: rgb(255, 255, 255); float: none; display: inline !important;" class="">binary format</span></span><span style="font-size: 12pt;" data-mce-style="font-size: 12pt;" class="">. They were extracted from a solver that only works with "scalar-type=complex" configuration.</span></div><div class="">I am getting weird results when I load them into a small test program that's configured with "scalar-type=real", but I believe this is expected.</div><div class="">At the end of the day, I would like to have both real and imaginary components as real-valued matrices.</div><div class="">Is it possible to do it? I want to<span style="font-family: arial, helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; float: none; display: inline !important;" data-mce-style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;" class=""> test preconditioners that are tailored for this sort of problem.</span></div><div class=""><br class=""></div><div class="">Regards,</div><div class=""> Frederico.</div></div><span class="s1" data-mce-style="font-size: 11pt; font-family: 'arial' , 'helvetica' , sans-serif; background-color: #ffffff; color: #000000;" style="font-family: arial, helvetica, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; font-size: 11pt; background-color: rgb(255, 255, 255);"></span><!--EndFragment--><div style="clear: both;" data-mce-style="clear: both;" class=""><br data-mce-bogus="1" class=""></div></div></div></div></div></blockquote></div><br class=""></div></body></html>