Q. of multi-componet system and data from input file

tsjb00 tsjb00 at hotmail.com
Tue May 13 10:14:38 CDT 2008


Many thanks for the reply! It really helps!
----------------------------------------
> Date: Mon, 12 May 2008 14:33:27 -0500
> From: knepley at gmail.com
> To: petsc-users at mcs.anl.gov
> Subject: Re: Q. of multi-componet system and data from input file
> 
> 2008/5/12 tsjb00 :
>>
>>  Hi, there! I am a beginner of PETSc and I have some questions about using PETSc to solve for a multi-componet system. The code is supposed to be applicable to different systems, where number of components, properties of components ,etc. would be input for the program.
>>
>>  Say I define DA with dof=number of components = nc, number of grid in x,y,z = nx,ny,nz respectively. When I use DA related functions, it seems that by default the data objects (vectors, arrays, etc.) would be of nx*ny*nz*nc. However, some physical variables are independent of specific components, which means I need to handle data objects of nx*ny*nz*integral. My questions are:
>>
>>  Does PETSc include tools or examples to deal with such problems?
> 
> Make a new DA for those vectors. DA are extremely small since they
> store O(1) data.
> 
>>  If not, how can I make sure the 'nx*ny*nz*any integral' data objects are distributed over the nodes in a way defined by DA? I am using PETSc_Decide for partitioning right now. I would prefer that at least the number of processors be flexible.
>>
>>  I need to read in a property f(x,y,z) from a data file and then distribute the data across different processors. Any suggestions on this would be appreciated. My concern is that if I use MPI_Send/Receive, the data to be transferred might correspond to discontinuous indices due to the partitioning.
> 
> If you store that data in PETSc Vec format, you can just use VecLoad()
> and we will distribute everything for you. A
> simple way to do this, is to read it in on 1 process, put it in a Vec,
> and VecView(). Then you can read it back in on
> multiple processes after that.
> 
>   Matt
> 
>>  Many thanks in advance!
>>
>>  BJ
>>
>> >
>>
>>
>>  _________________________________________________________________
>>  MSN 中文网,最新时尚生活资讯,白领聚集门户。
>>  http://cn.msn.com
>>
>>
> 
> 
> 
> -- 
> 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
> 

_________________________________________________________________
用手机MSN聊天写邮件看空间,无限沟通,分享精彩!
http://mobile.msn.com.cn/




More information about the petsc-users mailing list