<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hello everyone.</p>
<p>I noticed a strange feature, and I don't know if it is a small bug or if it is expected behaviour.</p>
<p>I have a DMPLEX read from a file, and I add a PetscFV field to it. For debugging purposes I want to name this PetscFV with PetscObjectSetName. But when later I create a global vector, the name of the field gets erased. Is it to be expected ?</p>
<p>Here is a minimal working example:</p>
<p><span style="font-family: courier new, courier, monospace;">#include <petscdmplex.h></span><br /><span style="font-family: courier new, courier, monospace;">int main(int argc, char **argv){</span><br /><span style="font-family: courier new, courier, monospace;"> PetscErrorCode ierr;</span><br /><br /><span style="font-family: courier new, courier, monospace;"> DM dm;</span><br /><span style="font-family: courier new, courier, monospace;"> PetscFV fvm;</span><br /><span style="font-family: courier new, courier, monospace;"> Vec x;</span><br /><br /><span style="font-family: courier new, courier, monospace;"> ierr = PetscInitialize(&argc, &argv, NULL, NULL); if (ierr) return ierr;</span><br /><span style="font-family: courier new, courier, monospace;"> ierr = DMCreate(PETSC_COMM_WORLD, &dm); CHKERRQ(ierr);</span><br /><span style="font-family: courier new, courier, monospace;"> ierr = DMSetType(dm, DMPLEX); CHKERRQ(ierr);</span><br /><span style="font-family: courier new, courier, monospace;"> ierr = PetscFVCreate(PETSC_COMM_WORLD, &fvm); CHKERRQ(ierr);</span><br /><span style="font-family: courier new, courier, monospace;"> ierr = DMAddField(dm, NULL, (PetscObject) fvm); CHKERRQ(ierr);</span><br /><span style="font-family: courier new, courier, monospace;"> ierr = PetscObjectSetName((PetscObject) fvm, "FV Model"); CHKERRQ(ierr);</span><br /><span style="font-family: courier new, courier, monospace;"> ierr = DMView(dm, PETSC_VIEWER_STDOUT_WORLD); CHKERRQ(ierr); <- Here the field is named "FV Model"</span><br /><span style="font-family: courier new, courier, monospace;"> ierr = DMCreateGlobalVector(dm, &x); CHKERRQ(ierr);</span><br /><span style="font-family: courier new, courier, monospace;"> ierr = DMView(dm, PETSC_VIEWER_STDOUT_WORLD); CHKERRQ(ierr)</span><span style="font-family: courier new, courier, monospace;">; <- Here the field is named "Field_0"</span><br /><br /><br /><span style="font-family: courier new, courier, monospace;"> ierr = VecDestroy(&x); CHKERRQ(ierr);</span><br /><span style="font-family: courier new, courier, monospace;"> ierr = PetscFVDestroy(&fvm); CHKERRQ(ierr);</span><br /><span style="font-family: courier new, courier, monospace;"> ierr = DMDestroy(&dm); CHKERRQ(ierr);</span><br /><span style="font-family: courier new, courier, monospace;"> ierr = PetscFinalize();</span><br /><span style="font-family: courier new, courier, monospace;"> return ierr;</span><br /><span style="font-family: courier new, courier, monospace;">}</span></p>
</body></html>