Re: [petsc-users] Calling Pytorch and Python within PETSc C/C++ code

2022-06-13 Thread Amneet Bhalla
Thanks for the information. We will check these examples out. Basically we have some trained ANNs that will provide few scalars to the C++ based CFD code. We won’t envision doing too much data transfer between C++ and Python/PyTorch. On Mon, Jun 13, 2022 at 2:11 PM Barry Smith wrote: > > Note

Re: [petsc-users] Calling Pytorch and Python within PETSc C/C++ code

2022-06-13 Thread Barry Smith
Note that your Python main ptsc4py program can call C/C++ code for some of its computations, so if you have a lot of C/C++ code you do not need to change it all to Python. It is also possible to call Petsc4py (and hence PyTorch) from a C/C++ main but a bit more cumbersome so not recommended.

Re: [petsc-users] Calling Pytorch and Python within PETSc C/C++ code

2022-06-13 Thread Zhang, Hong via petsc-users
No. It is not common to execute Python scripts or libraries from C/C++ code. If you are looking for ways to use PETSc and PyTorch together, it is best to build your application in Python so that you can use both petsc4py and PyTorch. See the following code for an example:

Re: [petsc-users] Writing VTK output

2022-06-13 Thread Jed Brown
This file is corrupted. It ends with $Elements 2 1 5 2 68 60 1 2 3 4 5 6 7 8 2 5 2 68 60 5 6 7 8 9 10 11 12 $EndElements//+ Show "*"; That should be $Elements 2 1 5 2 68 60 1 2 3 4 5 6 7 8 2 5 2 68 60 5 6 7 8 9 10 11 12 $EndElements If you fix it, then you can run $ make

Re: [petsc-users] [EXTERNAL] Re: Question about SuperLU

2022-06-13 Thread Xiaoye S. Li
Can you write down (in matrix notation) what does full VB matrix look like? Sherry On Mon, Jun 13, 2022 at 6:20 PM Tang, Qi wrote: > Sherry, > > -mat_superlu_dist_replacetinypivot > This flag makes superlu_dist back to working for the full VB block as we > would think. Thanks again for the

Re: [petsc-users] [EXTERNAL] Re: Question about SuperLU

2022-06-13 Thread Tang, Qi
Sherry, -mat_superlu_dist_replacetinypivot This flag makes superlu_dist back to working for the full VB block as we would think. Thanks again for the suggestion. Does this imply anything for the VB block matrix? Are we just unlucky or does that imply we have tiny terms along the diagonal and

[petsc-users] Calling Pytorch and Python within PETSc C/C++ code

2022-06-13 Thread Amneet Bhalla
Hi Guys, Is there a PETSc interface to make calls to Python scripts or libraries (e.g., Pytorch) from a C/C++ code making use of PETSc? If so, are there some examples that I refer to? Thanks, -- --Amneet

Re: [petsc-users] Writing VTK output

2022-06-13 Thread Matthew Knepley
Can you just send your GMsh file so I can see what you are asking for? Also, Plex stores hexes with outward normals, but some other programs store them with some inward normals. This should be converted in the output. I can check this if you send your mesh. Thanks, Matt On Sun, Jun 12,