Re: [petsc-users] Getting global indices of vector distributed among different processes.

2023-01-06 Thread Venugopal, Vysakh (venugovh) via petsc-users
, 2023 at 10:48 AM Venugopal, Vysakh (venugovh) via petsc-users mailto:petsc-users@mcs.anl.gov>> wrote: Hello, Is there a way to get the global indices from a vector created from DMCreateGlobalVector? Example: If global vector V (of size 10) has indices {0, 1, 2, 3, 4, 5, 6, 7

[petsc-users] Getting correct local size using VecScatterCreateToAll

2023-01-06 Thread Venugopal, Vysakh (venugovh) via petsc-users
Hello, I have created a global vector V using DMCreateGlobalVector of size m. For n processes, the local size of V is m/n. Subsequently, I am using VecScatterCreateToAll to get a sequential copy of the V, let's call it V_seq of local size m. It passes through a function and outputs the vector

[petsc-users] Getting global indices of vector distributed among different processes.

2023-01-04 Thread Venugopal, Vysakh (venugovh) via petsc-users
Hello, Is there a way to get the global indices from a vector created from DMCreateGlobalVector? Example: If global vector V (of size 10) has indices {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} and they are divided into 2 processes. Is there a way to get information such as (process 1: {0,1,2,3,4},

[petsc-users] Sequential to Parallel vector using VecScatter

2023-01-03 Thread Venugopal, Vysakh (venugovh) via petsc-users
Hi, Suppose I have a vector 'V' of global size m divided into 2 processes (making local size m/2). This vector V is derived from a DM object using DMCreateGlobalVector. I am using VecScatterCreateToAll to get a vector V_SEQ. Is there a way to distribute the V_SEQ to V (where each V has a

[petsc-users] about repeat of expensive functions using VecScatterCreateToAll

2023-01-17 Thread Venugopal, Vysakh (venugovh) via petsc-users
Hi, I am doing the following thing. Step 1. Create DM object and get global vector 'V' using DMGetGlobalVector. Step 2. Doing some parallel operations on V. Step 3. I am using VecScatterCreateToAll on V to create a sequential vector 'V_SEQ' using VecScatterBegin/End with SCATTER_FORWARD. Step

Re: [petsc-users] about repeat of expensive functions using VecScatterCreateToAll

2023-01-17 Thread Venugopal, Vysakh (venugovh) via petsc-users
. Or you may be able to apply the filter in Fourier space. PDE-filters are typically elliptic and can be parallelized. Blaise On Jan 17, 2023, at 4:38 PM, Venugopal, Vysakh (venugovh) via petsc-users mailto:petsc-users@mcs.anl.gov>> wrote: Thank you! I am doing a structural optimi

Re: [petsc-users] about repeat of expensive functions using VecScatterCreateToAll

2023-01-17 Thread Venugopal, Vysakh (venugovh) via petsc-users
VecScatterCreateToAll External Email: Use Caution On Jan 17, 2023, at 3:12 PM, Venugopal, Vysakh (venugovh) via petsc-users mailto:petsc-users@mcs.anl.gov>> wrote: Hi, I am doing the following thing. Step 1. Create DM object and get global vector ā€˜Vā€™ using DMGetGlobalVector. Step 2.

Re: [petsc-users] about repeat of expensive functions using VecScatterCreateToAll

2023-01-17 Thread Venugopal, Vysakh (venugovh) via petsc-users
, 2023, at 4:38 PM, Venugopal, Vysakh (venugovh) via petsc-users mailto:petsc-users@mcs.anl.gov>> wrote: Thank you! I am doing a structural optimization filter that inherently cannot be parallelized. Vysakh From: Barry Smith mailto:bsm...@petsc.dev>> Sent: Tuesday, January 17,

[petsc-users] global indices of a vector in each process

2023-01-30 Thread Venugopal, Vysakh (venugovh) via petsc-users
Hello, I am using a DMCreateGlobalVector to create a vector V. If V is divided into m processes, is there a way to get the global indices of V assigned to each process? For example: V = [10, 20, 30, 40, 50, 60, 70, 80]. If MPI process 0 has [10, 40, 50, 60] and process 1 has [20, 30, 70, 80],