I tried running the following loop for all elements:

        const Elem* elem = *el;                                                 
                                     
        elem->subdomain_id() = 2.;

I keep running into the following error: 
error: lvalue required as left operand of assignment
  elem->subdomain_id() = 2.;
                                       ^

I understand subdomain_id() should be returning a reference variable but all it 
does is return the value of subdomain id.
I tried this as well:
   
    const Elem* elem = *el;
    subdomain_id_type &run = elem->subdomain_id();
   
but still run into the following error
error: invalid initialization of non-const reference of type 
‘libMesh::subdomain_id_type& {aka short unsigned int&}’ from an rvalue of type 
‘libMesh::subdomain_id_type {aka short unsigned int}’
  subdomain_id_type &run = elem->subdomain_id();
                                              ^

I don't understand what I can be doing wrong here.

Regards
Amal

________________________________________
From: John Peterson [[email protected]]
Sent: Wednesday, July 22, 2015 6:47 PM
To: Sahai, Amal
Cc: [email protected]
Subject: Re: [Libmesh-users] Tecplot IO

On Wed, Jul 22, 2015 at 4:01 PM, Sahai, Amal 
<[email protected]<mailto:[email protected]>> wrote:
I have been using a 3D mesh in the Exodus II format created using Gridgen for 
my simulations. I meshed the full domain by creating multiple blocks of 
structured meshes. The tecplot IO for libmesh creates a .plt file which has a 
separate zone corresponding to each block in the full mesh. Is there a way to 
write the complete solution data for all the blocks into one single zone in the 
output .plt file? I would like to get rid of the internal edges (between 
contiguous zones) while making 3D plots in tecplot and I guess having a single 
zone would be the easiest way to do that.

Have you tried looping over the elements and setting elem->subdomain_id() to 
the same number before writing the Tecplot file?

Not sure exactly what you mean by "get rid of internal edges".  Are there 
lower-dimensional elements present in the Exodus file?  The TecplotIO writer 
won't work in that scenario anyway, see the documentation of 
TecplotIO::elem_dimension():

  /**
   * Determines the logical spatial dimension of the elements in the
   * Mesh.  Ex: A 1D edge element living in 3D is a logically
   * one-dimensional element as far as Tecplot is concerned.  Throws
   * an error if mixed-dimension element types are found, since I'm
   * not sure how to handle that case currently.
   */
  unsigned elem_dimension();

--
John
------------------------------------------------------------------------------
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to