[MOAB-dev] DMMoabCreateVector

Gerd Heber gheber at hdfgroup.org
Tue Nov 25 09:21:02 CST 2014


I'm a little confused about the use of DMMoabCreateVector.
I create a tag like this:

Field default_value = { 0.0, 0.0, 0.0 };
size_t u_tag_size = sizeof(Field)/sizeof(PetscScalar);
Tag u_tag;
merr = mbiface->tag_get_handle("u", u_tag_size,
				     MB_TYPE_DOUBLE, u_tag,
				     MB_TAG_DENSE|MB_TAG_CREAT,
				     &default_value);

Let N be the number of entities. If I then go on to create a PETSc Vec via

ierr = DMMoabCreateVector(dm, u_tag, owned, PETSC_TRUE, PETSC_FALSE, &u); 

and retrieve the (global) size of the Vec

ierr = VecGetSize(u, &size);

I get N as the answer. Why is it N rather than 3*N?

Should it be 3*N and I'm doing something stupid, or is it supposed to be N, which
I'd find somewhat counterintuitive. (What would be the relationship between that
Vec and the tag data?)

Thanks, G.





More information about the moab-dev mailing list