Re: [petsc-users] DMPlex and HDF5 vector ordering

2015-05-08 Thread Ataollah Mesgarnejad
Hi, I just made our fork public at https://bitbucket.org/mesgarnejad/petsc. It's working progress and nothing is settled yet but you can use it right now for saving and loading the global Vectors of the DMPlex you are using. Simply you should first set the global to natural SF by: PetscSF G2N;

Re: [petsc-users] Seg fault when trying to access the graph of pointSF from DMPlexDistribute

2015-04-08 Thread Ataollah Mesgarnejad
Thanks Matt, I knew you can pass NULL for a contiguous array but I didn’t suspect that you can get NULL from PetscSFGetGraph. Thank you for your time, Ata > On Apr 8, 2015, at 6:05 PM, Matthew Knepley wrote: > > On Wed, Apr 8, 2015 at 5:47 PM, Ataollah Mesgarnejad <

[petsc-users] Seg fault when trying to access the graph of pointSF from DMPlexDistribute

2015-04-08 Thread Ataollah Mesgarnejad
your help, Ata /** * @file * * Created by Ataollah Mesgarnejad on 3/31/15. * Copyright 2011 Ataollah Mesgarnejad. All rights reserved. * * This is a test distribute field * */ static char help[] = "An example of the usage of PetscSF to scatter data back and forth between a \ a dist

[petsc-users] getting a field's Vec from a DMPlex

2015-03-26 Thread Ataollah Mesgarnejad
Dear all, I was wondering if someone can tell me how you get a field's Vec (subVec of the global Vec) from a distributed DMPlex. It seems that DMCreateFieldIS works for sequential DMPlex but gives incorrect values for a distributed DMPlex. Many thanks, Ata

[petsc-users] combining two PetscSFs

2015-03-18 Thread Ataollah Mesgarnejad
Dear all, I was wondering if there is a way to combine two PetscSFs into one SF? e.g., I'm doing two back to back PetscSFBCasts: Vec1--(SF1)-->Vec2--(SF2)-->Vec3 is there a way to combine SF3=SF1+SF2 so I can do one PetscSFBcast: Vec1--(SF3)-->Vec3 Even i

Re: [petsc-users] DMView and DMLoad

2015-03-10 Thread Ataollah Mesgarnejad
Mar 9, 2015 at 11:28 AM, Ataollah Mesgarnejad < > ames...@tigers.lsu.edu> wrote: > >> Dear all, >> >> I'm trying to save and load distributed DMPlex in HDF5 format with DMView >> and DMLoad. The problem is even though there are no errors while loading >>

[petsc-users] DMView and DMLoad

2015-03-09 Thread Ataollah Mesgarnejad
re plus an input mesh file. Best, Ata /** * @file * * Created by Ataollah Mesgarnejad on 3/6/15. * * This is a test to read and write a distributed DM. * */ static char help[] = "An example of the usage of PetscSF to scatter data back and forth between a \ a serial DM and its pa

[petsc-users] [Libmesh-users] Convergence rate for petsc virs

2012-08-13 Thread Ataollah Mesgarnejad
Dmitry, On Aug 12, 2012, at 3:13 AM, Dmitry Karpeev wrote: > On Sat, Aug 11, 2012 at 6:36 PM, Subramanya Gautam Sadasiva purdue.edu> wrote: > Hi, > I was trying the snes solver on the obstacle problem by modifying > miscellaneous ex 7 and I get only linear convergence times.Is this what is >

[petsc-users] Solutions different after program restart

2012-06-03 Thread Ataollah Mesgarnejad
Dear Bojan, I'm not sure if this relates to your problem but I had a similar situation: I use KSPSetInitialGuessNonzero with GMRES. Setting DIFFERENT_NONZERO_PATTERN in KSPSetOperators solved my problem. Best, Ata; On Jun 3, 2012, at 10:28 AM, Jed Brown wrote: > On Sun, Jun 3, 2012 at 10:20 A

[petsc-users] writing native PETSc binaries in python

2012-04-27 Thread Ataollah Mesgarnejad
Thanks for the replies: Just a bug report with petsc4py: petsc4py which downloads with --download-petsc4py=1 is the older v1.1.1 which doesn't compile with petsc-dev? Thanks, Ata On Fri, Apr 27, 2012 at 8:25 AM, Matthew Knepley wrote: > On Fri, Apr 27, 2012 at 9:19 AM, Ataollah Mes

[petsc-users] writing native PETSc binaries in python

2012-04-27 Thread Ataollah Mesgarnejad
Dear all, I was wondering if there is way to write numpy arrays as native PETSc binaries in python so I can open them inside my program with VecView? Thanks, Ata -- next part -- An HTML attachment was scrubbed... URL:

[petsc-users] SNESVI convergence spped

2012-01-26 Thread Ataollah Mesgarnejad
ence since > the number of active constraints does not change so it should converge just > like plain old Newton. > > Barry > > > > On Jan 25, 2012, at 8:55 AM, Ataollah Mesgarnejad wrote: > >> Barry, >> >> Here is my output from my program with pe

[petsc-users] SNESVI convergence spped

2012-01-25 Thread Ataollah Mesgarnejad
Barry, Here is my output from my program with petsc-dev (txt files attached). Even with petsc-dev (revision 21929), SNES (I tried VISS and VIRS) takes a long time to converge (>50 iterations) from a small problem (99 HEX20 elements, 681 DOFs for SNES). The exodusII output files are uploaded in

[petsc-users] SNESVI convergence spped

2012-01-22 Thread Ataollah Mesgarnejad
files). > > > Barry > > On Jan 18, 2012, at 9:40 AM, Ataollah Mesgarnejad wrote: > >> Dear all, >> >> Just realized that my email didn't go through because of my attachments, so >> here it is: >> >> Sorry if it took a bit long to do th

[petsc-users] SNESVI convergence spped

2012-01-18 Thread Ataollah Mesgarnejad
he degrees of freedom would bump >>> up against the upper obstacle all at once. >>> >>> Dmitry. >>> >>> On Mon, Jan 16, 2012 at 8:05 PM, Barry Smith wrote: >>> >>> What do you get with -snes_vi_monitor it could be it is taking a while t

[petsc-users] SNESVI convergence spped

2012-01-17 Thread Ataollah Mesgarnejad
ution is highly oscillatory, possibly further >>> exacerbating the problem. It's possible that it would be better if V just >>> diverged uniformly. Then nearly all of the degrees of freedom would bump >>> up against the upper obstacle all at once. >>> &

[petsc-users] SNESVI convergence spped

2012-01-16 Thread Ataollah Mesgarnejad
> What is the solution that you end up converging to I get the correct solution. > , and what are the boundary conditions? > I have natural BCs everywhere ( dV/dn=0) so I don't force it explicitly. Ata > Thanks. > Dmitry. > > On Mon, Jan 16, 2012 at 6:2

[petsc-users] SNESVI convergence spped

2012-01-16 Thread Ataollah Mesgarnejad
Dear all, I'm trying to use SNESVI to solve a quadratic problem with box constraints. My problem in FE context reads: (\int_{Omega} E phi_i phi_j + \alpha \epsilon dphi_i dphi_j dx) V_i - (\int_{Omega} \alpha \frac{phi_j}{\epsilon} dx) = 0 , 0<= V <= 1 or: [A]{V}-{b}={0} here phi is the basi

[petsc-users] convergence with PCLU

2011-09-12 Thread Ataollah Mesgarnejad
Dear all, I was running an small problem (~9000 unknowns) and I decided to try the direct solver with PCLU. What is puzzling me is that when it converges if I check the residual with KSPGetResidualNorm it gives me zero but when I calculate the residual myself ( ||r||:=||Ax-b||) it gives me ||r|

[petsc-users] Problem with VecLoadIntoVector

2011-08-05 Thread Ataollah Mesgarnejad
Dear all, I'm having a very strange problem: I read my vectors from binary files I wrote with VecView, using VecLoadIntoVector; Everything goes smoothly but then when I try to get the local vector on multiple processors , my code stalls at DAGlobalToLocalEnd! Code does not generate any errors e

[petsc-users] KSP convergence

2011-08-05 Thread Ataollah Mesgarnejad
On Aug 5, 2011, at 11:47 AM, Barry Smith wrote: > > On Aug 5, 2011, at 10:43 AM, Ataollah Mesgarnejad wrote: > >> Dear all, >> >> I use KSPSetInitialGuessNonzero for my KSP solver and it works perfectly. >> But when I restart my computations (I read petsc

[petsc-users] KSP convergence

2011-08-05 Thread Ataollah Mesgarnejad
Dear all, I use KSPSetInitialGuessNonzero for my KSP solver and it works perfectly. But when I restart my computations (I read petsc binaries and set up my fields) the first KSP solve takes forever. I guess my question is: is there a way to set the initial guess for KSP back to where it was bef

[petsc-users] hdf5 directive

2011-07-26 Thread Ataollah Mesgarnejad
Dear all, Is there a preprocessor directive to check if PETSc has been compiled with hdf5 or not ? (something like PETSC_HAS_HDF5?!!) Best, Ata

[petsc-users] reading petsc binary vec in python.

2011-07-19 Thread Ataollah Mesgarnejad
es to read objects until it gets an error saying the file is empty. > Try something for me: > > change line 119 of PetscBinaryRead.py to read: > > except MemoryError, IndexError: > > Does that fix it? > > Thanks, > > Ethan > > > On Mon, 2011-07-

[petsc-users] reading petsc binary vec in python.

2011-07-18 Thread Ataollah Mesgarnejad
esn't know how many objects are in the file, > tries to read objects until it gets an error saying the file is empty. > Try something for me: > > change line 119 of PetscBinaryRead.py to read: > > except MemoryError, IndexError: > > Does that fix it? > > Than

[petsc-users] reading petsc binary vec in python.

2011-07-18 Thread Ataollah Mesgarnejad
Thanks Ethan, I did as you said but when I try to read the file using: petsc_objs = PetscBinaryRead.readBinaryFile('V-018.bin') I get the following error: Traceback (most recent call last): File "./petscvec.py", line 4, in petsc_objs = PetscBinaryRead.readBinaryFile('V-018.bin') File

[petsc-users] reading petsc binary vec in python.

2011-07-18 Thread Ataollah Mesgarnejad
Dear all, I create a petsc binary output using VecView from a structured da grid. How can I read it in python if I know domains size? Best, Ata

[petsc-users] Ksp Null space

2011-05-16 Thread Ataollah Mesgarnejad
t; > > On May 16, 2011, at 12:39 PM, Ataollah Mesgarnejad wrote: > > > Dear all, > > > > Does anyone know of any example programs that use MatNullSpaceCreate and > KSPsetNullSpace routines? > > > > Best, > > Ata > > -- A. Mesgarnejad PhD St

[petsc-users] Ksp Null space

2011-05-16 Thread Ataollah Mesgarnejad
Dear all, Does anyone know of any example programs that use MatNullSpaceCreate and KSPsetNullSpace routines? Best, Ata -- next part -- An HTML attachment was scrubbed... URL:

[petsc-users] checking for hypre in preprocessor

2011-05-07 Thread Ataollah Mesgarnejad
Dear all, Is there a way to check if PETSc is compiled with Hypre using C preprocessor directives? (something like #ifdef WITH_HYPRE) Best, Ata Mesgarnejad

[petsc-users] reading text files

2011-03-30 Thread Ataollah Mesgarnejad
Dear all, I have a small file that need to read. I use PetscFOpen and PetscFPrintf to write it,so I wonder if there is a PetscFScanf too? Cheers, Ata

[petsc-users] KspTrueResidualNorm

2011-02-01 Thread Ataollah Mesgarnejad
error message like this is not normal and rarely seen. > >Barry > > On Feb 1, 2011, at 3:32 PM, Matthew Knepley wrote: > > > On Tue, Feb 1, 2011 at 3:27 PM, Ataollah Mesgarnejad < > amesga1 at tigers.lsu.edu> wrote: > > I compile it with openmpi and it runs

[petsc-users] KspTrueResidualNorm

2011-02-01 Thread Ataollah Mesgarnejad
11 at 2:35 PM, Barry Smith wrote: > > Right preconditioner shouldn't matter to the preconditioner at all. What > is the complete error message. Does it run on one process? > > Barry > > On Feb 1, 2011, at 2:32 PM, Ataollah Mesgarnejad wrote: > > > Barry, >

[petsc-users] KspTrueResidualNorm

2011-02-01 Thread Ataollah Mesgarnejad
Sorry for too many replies but it worked with -Ksp_monitor !!! I reported the same kind of problem before too. Best, Ata On Tue, Feb 1, 2011 at 2:32 PM, Ataollah Mesgarnejad wrote: > Barry, > > I did as you said and now I receive these errors once I try to run the > program: > &

[petsc-users] KspTrueResidualNorm

2011-02-01 Thread Ataollah Mesgarnejad
> > > On Feb 1, 2011, at 2:14 PM, Ataollah Mesgarnejad wrote: > > > Dear all, > > > > I'm using Ksp gmres with boomeramg preconditioning and I suspect that > even though it converges in preconditioned norm it doesn't converge in true > norm, but as I un

[petsc-users] KspTrueResidualNorm

2011-02-01 Thread Ataollah Mesgarnejad
Dear all, I'm using Ksp *gmres* with *boomeramg* preconditioning and I suspect that even though it converges in preconditioned norm it doesn't converge in true norm, but as I understand *KSPSetNormType* gmres does not support true residual norm? Is that correct and If it is, is there any other way

[petsc-users] PetscViewerASCIIOpen

2011-01-19 Thread Ataollah Mesgarnejad
Awesome. Thanks. On Wed, Jan 19, 2011 at 11:14 AM, Matthew Knepley wrote: > On Wed, Jan 19, 2011 at 10:57 AM, Ataollah Mesgarnejad < > amesga1 at tigers.lsu.edu> wrote: > >> Dear All, >> >> Is there a way to change the file write mode to append when using >&g

[petsc-users] PetscViewerASCIIOpen

2011-01-19 Thread Ataollah Mesgarnejad
Dear All, Is there a way to change the file write mode to append when using PetscViewerASCIIOpen ? Thanks, Ata M -- next part -- An HTML attachment was scrubbed... URL:

[petsc-users] info file

2011-01-16 Thread Ataollah Mesgarnejad
Neat. Thanks Matt. On Jan 16, 2011, at 3:53 PM, Matthew Knepley wrote: > http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Viewer/PetscViewerBinarySkipInfo.html > > Matt > > On Sun, Jan 16, 2011 at 3:47 PM, Ataollah Mesgarnejad gmail.com>

[petsc-users] info file

2011-01-16 Thread Ataollah Mesgarnejad
Dear All, I use VecView with a binary PETSc viewer to output my data it always creates bunch of blank info files. It's not a big inconvenience but is there a way to write my data without creating these info files? Best, Ata M

[petsc-users] PetscMallocAlign

2011-01-12 Thread Ataollah Mesgarnejad
PFMAT-main.cpp:206) ==3347== Ata On Jan 12, 2011, at 1:36 PM, Satish Balay wrote: > perhaps you are missing a call to VecDestroy() on the vec created by > DACreateGlobalVector? > > Satish > > On Wed, 12 Jan 2011, Ataollah Mesgarnejad wrote: > >> Dear All, >> &

[petsc-users] PetscMallocAlign

2011-01-12 Thread Ataollah Mesgarnejad
Dear All, I have a memory leak problem with my program; it eventually exhausts all the memory on my system and program aborts. I was checking memory usage with Valgrind and there is a persistent error that always traces back PetscMallocAlign. Something like: ==2918== ==2918== 18,792 bytes in