[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Trouble with DA, multiple degrees of freedom
- To: petsc-users@xxxxxxxxxxx
- Subject: Trouble with DA, multiple degrees of freedom
- From: "Pearl Flath" <pflath@xxxxxxxxxxxxxxx>
- Date: Tue, 5 Feb 2008 13:50:51 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:x-google-sender-auth; bh=jNYEkZrrJM6dMFsM+LROekkj3MCc0FnIQS9Lk3pTmdo=; b=Tu0gtEokQ/5X0CkP1wOc044LRsjqVCSqMbiOzyvQWx8NaNeER0YL+m12hnd+61ccz/JX6hGcxLtDhMoaALJekyU17s80s5pWb2IIWhyV5bNyhBrXQ3GQejHrErgdt44jqaUks/q/8N94xC5aztO7I5FbJMtf0Qkx+FGSBnPYBS8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:mime-version:content-type:x-google-sender-auth; b=r8JUZ5ZIYx6QvCAuMXn1he260fEmQHp7cNkcBhKEjv2sx+1SzrL/6/7ckcJK7pJKbCON/QzhHJ5HpG+EZoAAtq9qNcQ2y+HmofS4yrGiC0AZaeG8gIEaWG4vXZ8IBXpu7HlPF4RO0ktOvcMkYjQnAX8XgdOUGEVa+2iAb6UEz/E=
- Reply-to: petsc-users@xxxxxxxxxxx
- Sender: owner-petsc-users@xxxxxxxxxxx
Dear All,
I have a code where the velocity (three components) and pressure are all stored in a distributed array with 4 degrees of freedom per node. I'd like to take one component of the velocity and multiply it by -1, but I am having trouble figuring out how to access that. I believe it must involve DAVecGetArrayDOF or DAVecGetArray, but I haven't managed to get either to work. I've attached a code fragment where it loads the velocity. Could someone suggest how to do this or point me to where I can find additional discussion of this? I've read the users manual on DA already.
Sincerely,
Pearl Flath
ICES, UT Austin
---------------------------------
DACreate3d(PETSC_COMM_WORLD,DA_NONPERIODIC,DA_STENCIL_BOX,m,n,p,
PETSC_DECIDE,PETSC_DECIDE,PETSC_DECIDE,
4,1,PETSC_NULL,PETSC_NULL,PETSC_NULL,&daV);
DACreateGlobalVector(daV, &vel);
// Set the velocity file to read from
PetscTruth flg ;
PetscViewer view_u;
char velocityfile[1024] ;
PetscOptionsGetString(0,"-velocityfile",velocityfile,1023,&flg);
PetscViewerBinaryOpen(PETSC_COMM_WORLD, velocityfile,
FILE_MODE_READ, &view_u);
VecLoadIntoVector(view_u, vel);
PetscViewerDestroy(view_u);