[petsc-users] questions

xiaohl xiaohl at ices.utexas.edu
Fri Nov 11 12:06:59 CST 2011


 Hi

 I am going to use user defined context for this function call
 DMDASetLocalFunction(da,(DMDALocalFunction1) FormFunctionLocal);

 But How can I pass the "ctx" to the function FormFunctionLocal;

 PetscErrorCode FormFunctionLocal(DMDALocalInfo *info, PetscScalar ***u,
 				 PetscScalar ***f, void * ctx){
 }

 I look at the example
 /petsc-3.2-p2/src/snes/examples/tutorials/ex19.c.html

 I think you intialize the "user" context  by
 DMMGCreate(comm,nlevels,&user,&dmmg);
 for DMMG

 Do you have the similar routine for DMDA?


 Hailong

 On Wed, 2 Nov 2011 15:53:27 -0500, Barry Smith <bsmith at mcs.anl.gov> 
 wrote:
> On Nov 2, 2011, at 3:42 PM, Matthew Knepley wrote:
>
>> On Wed, Nov 2, 2011 at 8:38 PM, xiaohl <xiaohl at ices.utexas.edu> 
>> wrote:
>> Hi
>>
>> I am going to implement cell center difference method for
>> u = - K grad p
>> div u = f
>> where p is the pressure , u is the velocity, f is the source term.
>>
>> my goal is to assemble the matrix and test the performance of 
>> different linear solvers in parallel.
>>
>> my question is how can I read the input file for K where K is n*n 
>> tensor.
>>
>> MatLoad()
>
>    Hm, I think you should use a DMDA with n*n size dof and then use
> VecLoad() to load the entries of K.
>
>    Barry
>
>>
>> second one is that do you have any similar examples?
>>
>> Nothing with the mixed-discretization of the Laplacian.
>>
>>    Matt
>>
>> Hailong
>>
>>
>>
>> --
>> What most experimenters take for granted before they begin their 
>> experiments is infinitely more interesting than any results to which 
>> their experiments lead.
>> -- Norbert Wiener



More information about the petsc-users mailing list