From: robert <rob...@un...> - 2011-08-03 13:26:54
|
Hi to all, I want to read a mesh from a tetgen-output file. In tetgen I have specified different regions. Now I am trying to read the mesh by: Mesh new_mesh; new_mesh.read("mesh/almirante_box.1.ele"); Here are the first lines of my *.ele file: 542385 4 1 1 16340 63454 13659 86041 1 2 44851 69045 38700 85823 1 3 39598 38395 28168 28167 1 4 54393 80195 67081 80196 2 5 15767 74613 35521 53993 2 6 11944 83706 12467 87606 1 7 5102 6153 7395 16715 2 8 75849 79502 33646 79520 1 9 10026 61126 14569 71718 1 10 50667 50803 33989 79888 1 As you can see, the last figures describe to which region the respective tetrahedra belongs. However, now I am stuck with the quite simple problem to find these values in my libmesh-mesh. I have tried something like: elem->subdomain_id(); when looping through the elements. But since the new_mesh.n_subdomains() returns 1, this didn't work. Thank you for your help, Robert |
From: John P. <jwp...@gm...> - 2011-08-03 15:01:35
|
On Wed, Aug 3, 2011 at 7:10 AM, robert <rob...@un...> wrote: > Hi to all, > > I want to read a mesh from a tetgen-output file. In tetgen I have > specified different regions. Now I am trying to read the mesh by: > > Mesh new_mesh; > new_mesh.read("mesh/almirante_box.1.ele"); > > > Here are the first lines of my *.ele file: > > 542385 4 1 > 1 16340 63454 13659 86041 1 > 2 44851 69045 38700 85823 1 > 3 39598 38395 28168 28167 1 > 4 54393 80195 67081 80196 2 > 5 15767 74613 35521 53993 2 > 6 11944 83706 12467 87606 1 > 7 5102 6153 7395 16715 2 > 8 75849 79502 33646 79520 1 > 9 10026 61126 14569 71718 1 > 10 50667 50803 33989 79888 1 > > > As you can see, the last figures describe to which region the respective > tetrahedra belongs. However, now I am stuck with the quite simple > problem to find these values in my libmesh-mesh. > I have tried something like: > > elem->subdomain_id(); > > when looping through the elements. But since the new_mesh.n_subdomains() > returns 1, this didn't work. Looks like at the moment, we read in and discard the last value(s), but we could easily use it to set the subdomain_id... Apparently there can be any number of "attributes" specified for each element, but I don't think there's a way to specify in the file what each attribute means. Could you send me a much smaller example mesh file (or tell me the steps used to create it)? I've never used tetgen directly before. I also suspect this code will need a few updates for ParallelMesh... -- John |
From: robert <rob...@un...> - 2011-08-03 18:36:08
|
Hi John, I found a simple way to work around the problem. I just added a public vector std::vector<Real> roberts_region; to the class TetGenIO. In the according function TetGenIO::read(...) the following is already implemented: // Read attributes from the stream. for (unsigned int j=0; j<nAttri; j++) ele_stream >> dummy; . This can be found around line 251 of tetgen_io.C (version 0.7.1). Here, I just added roberts_region.push_back(dummy); Now, I just have to create an object TetGenIO TETGEN when reading the mesh and with TETGEN.roberts_region.at(...) I can get my attributes. I do this immediately after reading the mesh and before any refinement. This is maybe not the most elegant way to do it. However, it seems to work. Regards, Robert Am Mittwoch, den 03.08.2011, 09:01 -0600 schrieb John Peterson: > On Wed, Aug 3, 2011 at 7:10 AM, robert <rob...@un...> wrote: > > Hi to all, > > > > I want to read a mesh from a tetgen-output file. In tetgen I have > > specified different regions. Now I am trying to read the mesh by: > > > > Mesh new_mesh; > > new_mesh.read("mesh/almirante_box.1.ele"); > > > > > > Here are the first lines of my *.ele file: > > > > 542385 4 1 > > 1 16340 63454 13659 86041 1 > > 2 44851 69045 38700 85823 1 > > 3 39598 38395 28168 28167 1 > > 4 54393 80195 67081 80196 2 > > 5 15767 74613 35521 53993 2 > > 6 11944 83706 12467 87606 1 > > 7 5102 6153 7395 16715 2 > > 8 75849 79502 33646 79520 1 > > 9 10026 61126 14569 71718 1 > > 10 50667 50803 33989 79888 1 > > > > > > As you can see, the last figures describe to which region the respective > > tetrahedra belongs. However, now I am stuck with the quite simple > > problem to find these values in my libmesh-mesh. > > I have tried something like: > > > > elem->subdomain_id(); > > > > when looping through the elements. But since the new_mesh.n_subdomains() > > returns 1, this didn't work. > > Looks like at the moment, we read in and discard the last value(s), > but we could easily use it to set the subdomain_id... > > Apparently there can be any number of "attributes" specified for each > element, but I don't think there's a way to specify in the file what > each attribute means. > > Could you send me a much smaller example mesh file (or tell me the > steps used to create it)? I've never used tetgen directly before. > > I also suspect this code will need a few updates for ParallelMesh... > |
From: John P. <jwp...@gm...> - 2011-08-03 22:49:24
|
On Wed, Aug 3, 2011 at 12:36 PM, robert <rob...@un...> wrote: > Hi John, > > I found a simple way to work around the problem. I just added a public > vector > > std::vector<Real> roberts_region; > > to the class TetGenIO. In the according function TetGenIO::read(...) the > following is already implemented: > > // Read attributes from the stream. > for (unsigned int j=0; j<nAttri; j++) > ele_stream >> dummy; > > . This can be found around line 251 of tetgen_io.C (version 0.7.1). > Here, I just added > > roberts_region.push_back(dummy); > > Now, I just have to create an object TetGenIO TETGEN when reading the > mesh and with TETGEN.roberts_region.at(...) I can get my attributes. > I do this immediately after reading the mesh and before any refinement. > > This is maybe not the most elegant way to do it. However, it seems to > work. I just checked in something similar but slightly more general in that it will read multiple attributes per element as well as node attributes. They are stored in the public members "element_attributes" and "node_attributes" respectively, which are vector<vector<Real> >'s. Here's some test code you can try out, it seemed to work fine with the mesh file you sent me... // Manual IO object creation. We need to use this if // we want the attributes to hang around after the reading is finished... TetGenIO t(mesh); t.read(filename); unsigned n_elem_attributes = t.element_attributes.size(); unsigned n_node_attributes = t.node_attributes.size(); // Assign subdomain IDs based on the read in element attributes if (n_elem_attributes == 1) { MeshBase::element_iterator it = mesh.elements_begin(); const MeshBase::element_iterator end = mesh.elements_end(); unsigned ctr=0; for ( ; it != end; ++it, ctr++) { Elem* elem = *it; // Assign the subdomain ID from t.element_attributes[0] elem->subdomain_id() = static_cast<subdomain_id_type>(t.element_attributes[0][ctr]); } // end loop over elements } // end if n_elem_attributes // Write out the mesh in a different (Exodus) format mesh.write("tetgen_read_test.e"); -- John |
From: robert <rob...@un...> - 2011-08-04 09:48:59
|
Hi, could you just tell me how you implemented the public members 'element_attributes' and 'node_attributes'? In tetgen_io.C I just tried: std::vector<Real> el_attr; // Read attributes from the stream. for (unsigned int j=0; j<nAttri; j++){ ele_stream >> dummy; ///roberts_region.push_back(dummy); /// by R.B. el_attr.push_back(dummy); } if (el_attr.size()>0) /// by R.B. element_attributes.push_back(el_attr); /// by R.B. nAttriel = nAttri; /// by R.B. } where element_attributes is defined as public: std::vector< std::vector<Real> > in tetgen_io.h. I did the same for node_attributes. However, I get some bad alloc when reading the mesh. Thank you, Robert Am Mittwoch, den 03.08.2011, 16:48 -0600 schrieb John Peterson: > On Wed, Aug 3, 2011 at 12:36 PM, robert <rob...@un...> wrote: > > Hi John, > > > > I found a simple way to work around the problem. I just added a public > > vector > > > > std::vector<Real> roberts_region; > > > > to the class TetGenIO. In the according function TetGenIO::read(...) the > > following is already implemented: > > > > // Read attributes from the stream. > > for (unsigned int j=0; j<nAttri; j++) > > ele_stream >> dummy; > > > > . This can be found around line 251 of tetgen_io.C (version 0.7.1). > > Here, I just added > > > > roberts_region.push_back(dummy); > > > > Now, I just have to create an object TetGenIO TETGEN when reading the > > mesh and with TETGEN.roberts_region.at(...) I can get my attributes. > > I do this immediately after reading the mesh and before any refinement. > > > > This is maybe not the most elegant way to do it. However, it seems to > > work. > > I just checked in something similar but slightly more general in that > it will read multiple attributes per element as well as node > attributes. > > They are stored in the public members "element_attributes" and > "node_attributes" respectively, which are vector<vector<Real> >'s. > > Here's some test code you can try out, it seemed to work fine with the > mesh file you sent me... > > // Manual IO object creation. We need to use this if > // we want the attributes to hang around after the reading is finished... > TetGenIO t(mesh); > t.read(filename); > > unsigned n_elem_attributes = t.element_attributes.size(); > unsigned n_node_attributes = t.node_attributes.size(); > > // Assign subdomain IDs based on the read in element attributes > if (n_elem_attributes == 1) > { > MeshBase::element_iterator it = mesh.elements_begin(); > const MeshBase::element_iterator end = mesh.elements_end(); > unsigned ctr=0; > for ( ; it != end; ++it, ctr++) > { > Elem* elem = *it; > > // Assign the subdomain ID from t.element_attributes[0] > elem->subdomain_id() = > static_cast<subdomain_id_type>(t.element_attributes[0][ctr]); > } // end loop over elements > } // end if n_elem_attributes > > // Write out the mesh in a different (Exodus) format > mesh.write("tetgen_read_test.e"); > |
From: John P. <jwp...@gm...> - 2011-08-04 13:43:52
|
On Thu, Aug 4, 2011 at 3:48 AM, robert <rob...@un...> wrote: > Hi, > > could you just tell me how you implemented the public members > 'element_attributes' and 'node_attributes'? In tetgen_io.C I just tried: > > std::vector<Real> el_attr; > // Read attributes from the stream. > for (unsigned int j=0; j<nAttri; j++){ > ele_stream >> dummy; > ///roberts_region.push_back(dummy); /// by R.B. > el_attr.push_back(dummy); > } > if (el_attr.size()>0) /// by R.B. > element_attributes.push_back(el_attr); /// by R.B. > nAttriel = nAttri; /// by R.B. > > } > > where element_attributes is defined as public: std::vector< > std::vector<Real> > in tetgen_io.h. I did the same for node_attributes. > However, I get some bad alloc when reading the mesh. Use the test code I posted as an example. There is no reason to have the vector el_attr or push_back() anything yourself, it's already handled by the TetGenIO class. -- John |
From: robert <rob...@un...> - 2011-08-04 14:07:21
|
I tried to add the vectors myself because with libmesh-version 0.7.1 I get the following errors: ThermoPaine3d.C: In function ‘int main(int, char**)’: ThermoPaine3d.C:238: error: ‘class libMesh::TetGenIO’ has no member named ‘element_attributes’ ThermoPaine3d.C:239: error: ‘class libMesh::TetGenIO’ has no member named ‘node_attributes’ make: *** [ThermoPaine3d.i686-pc-linux-gnu.opt.o] Fehler 1 robert@robert:~/Desktop/THERMO_PAINE/3D$ Am Mittwoch, den 03.08.2011, 16:48 -0600 schrieb John Peterson: > On Wed, Aug 3, 2011 at 12:36 PM, robert <rob...@un...> wrote: > > Hi John, > > > > I found a simple way to work around the problem. I just added a public > > vector > > > > std::vector<Real> roberts_region; > > > > to the class TetGenIO. In the according function TetGenIO::read(...) the > > following is already implemented: > > > > // Read attributes from the stream. > > for (unsigned int j=0; j<nAttri; j++) > > ele_stream >> dummy; > > > > . This can be found around line 251 of tetgen_io.C (version 0.7.1). > > Here, I just added > > > > roberts_region.push_back(dummy); > > > > Now, I just have to create an object TetGenIO TETGEN when reading the > > mesh and with TETGEN.roberts_region.at(...) I can get my attributes. > > I do this immediately after reading the mesh and before any refinement. > > > > This is maybe not the most elegant way to do it. However, it seems to > > work. > > I just checked in something similar but slightly more general in that > it will read multiple attributes per element as well as node > attributes. > > They are stored in the public members "element_attributes" and > "node_attributes" respectively, which are vector<vector<Real> >'s. > > Here's some test code you can try out, it seemed to work fine with the > mesh file you sent me... > > // Manual IO object creation. We need to use this if > // we want the attributes to hang around after the reading is finished... > TetGenIO t(mesh); > t.read(filename); > > unsigned n_elem_attributes = t.element_attributes.size(); > unsigned n_node_attributes = t.node_attributes.size(); > > // Assign subdomain IDs based on the read in element attributes > if (n_elem_attributes == 1) > { > MeshBase::element_iterator it = mesh.elements_begin(); > const MeshBase::element_iterator end = mesh.elements_end(); > unsigned ctr=0; > for ( ; it != end; ++it, ctr++) > { > Elem* elem = *it; > > // Assign the subdomain ID from t.element_attributes[0] > elem->subdomain_id() = > static_cast<subdomain_id_type>(t.element_attributes[0][ctr]); > } // end loop over elements > } // end if n_elem_attributes > > // Write out the mesh in a different (Exodus) format > mesh.write("tetgen_read_test.e"); > |
From: John P. <jwp...@gm...> - 2011-08-04 14:12:59
|
On Thu, Aug 4, 2011 at 8:07 AM, robert <rob...@un...> wrote: > I tried to add the vectors myself because > with libmesh-version 0.7.1 I get the following errors: > > ThermoPaine3d.C: In function ‘int main(int, char**)’: > ThermoPaine3d.C:238: error: ‘class libMesh::TetGenIO’ has no member > named ‘element_attributes’ > ThermoPaine3d.C:239: error: ‘class libMesh::TetGenIO’ has no member > named ‘node_attributes’ > make: *** [ThermoPaine3d.i686-pc-linux-gnu.opt.o] Fehler 1 > robert@robert:~/Desktop/THERMO_PAINE/3D$ Sorry, I just assumed you were working with the SVN version of libmesh. My changes are only in SVN at this point so you won't be able to make use of them. Unless you want to switch over to SVN, you'll have to stick with your original code to read the tetgen attributes. -- John |
From: robert <rob...@un...> - 2011-08-04 16:42:52
|
I just have to disturb you with an other question. After reading the mesh with the TetGenIO object I have invalid boundary id's. So, I tried to loop through the elements and their sides and do something like: mesh.boundary_info->boundary_id (elem,s) = (short int) 0; Since the above function is defined as 'short int boundary_id (const Elem *const elem, const unsigned short int side) const' with the element constant, it did not work. How can I set the boundary_id? Thank you, Robert Am Donnerstag, den 04.08.2011, 08:12 -0600 schrieb John Peterson: > On Thu, Aug 4, 2011 at 8:07 AM, robert <rob...@un...> wrote: > > I tried to add the vectors myself because > > with libmesh-version 0.7.1 I get the following errors: > > > > ThermoPaine3d.C: In function ‘int main(int, char**)’: > > ThermoPaine3d.C:238: error: ‘class libMesh::TetGenIO’ has no member > > named ‘element_attributes’ > > ThermoPaine3d.C:239: error: ‘class libMesh::TetGenIO’ has no member > > named ‘node_attributes’ > > make: *** [ThermoPaine3d.i686-pc-linux-gnu.opt.o] Fehler 1 > > robert@robert:~/Desktop/THERMO_PAINE/3D$ > > Sorry, I just assumed you were working with the SVN version of libmesh. > > My changes are only in SVN at this point so you won't be able to make > use of them. > > Unless you want to switch over to SVN, you'll have to stick with your > original code to read the tetgen attributes. > |
From: John P. <jwp...@gm...> - 2011-08-04 16:46:20
|
On Thu, Aug 4, 2011 at 10:42 AM, robert <rob...@un...> wrote: > I just have to disturb you with an other question. After reading the > mesh with the TetGenIO object I have invalid boundary id's. So, I tried > to loop through the elements and their sides and do something like: > > mesh.boundary_info->boundary_id (elem,s) = (short int) 0; > > Since the above function is defined as > 'short int boundary_id (const Elem *const elem, const unsigned short int > side) const' > with the element constant, it did not work. How can I set the > boundary_id? mesh.boundary_info->add_side (elem,s, 0); -- John |
From: robert <rob...@un...> - 2011-08-12 10:21:13
|
Hello, again, I have a question as far as reading meshes with tetgen is concered. I read a mesh by Mesh new_mesh; EquationSystems new_equation_systems (new_mesh); TetGenIO TETGEN(new_mesh); OStringStream inmesh; inmesh<<"geometry_wings/export_pov/out/"<<ReadMesh[actual_pulse]<<"_box.1.ele"; TETGEN.read(inmesh.str().c_str()); . Afterwards, if I look at the equation system I get n_dofs() = 0; Up to now I have looped through the nodes and MeshBase::node_iterator nd = mesh.nodes_begin(); const MeshBase::node_iterator end_nd = mesh.nodes_end(); int proc = 0; for ( ; nd != end_nd; ++nd){ Node* NOD = *nd; NOD->processor_id() = proc; } My question now is, if the code still works in parallel? I would say yes. As far as I know is the mesh always be on CPU, isn't it (unless I use ParallelMesh which seems to be in developement stade). So, if I read a mesh like above, manually set the processor ids and use a code like ex9, everything works like if I created the mesh with libmesh? thanks, Robert Am Donnerstag, den 04.08.2011, 11:48 +0200 schrieb robert: > Hi, > > could you just tell me how you implemented the public members > 'element_attributes' and 'node_attributes'? In tetgen_io.C I just tried: > > std::vector<Real> el_attr; > // Read attributes from the stream. > for (unsigned int j=0; j<nAttri; j++){ > ele_stream >> dummy; > ///roberts_region.push_back(dummy); /// by R.B. > el_attr.push_back(dummy); > } > if (el_attr.size()>0) /// by R.B. > element_attributes.push_back(el_attr); /// by R.B. > nAttriel = nAttri; /// by R.B. > > } > > where element_attributes is defined as public: std::vector< > std::vector<Real> > in tetgen_io.h. I did the same for node_attributes. > However, I get some bad alloc when reading the mesh. > > Thank you, > Robert > > > > > Am Mittwoch, den 03.08.2011, 16:48 -0600 schrieb John Peterson: > > On Wed, Aug 3, 2011 at 12:36 PM, robert <rob...@un...> wrote: > > > Hi John, > > > > > > I found a simple way to work around the problem. I just added a public > > > vector > > > > > > std::vector<Real> roberts_region; > > > > > > to the class TetGenIO. In the according function TetGenIO::read(...) the > > > following is already implemented: > > > > > > // Read attributes from the stream. > > > for (unsigned int j=0; j<nAttri; j++) > > > ele_stream >> dummy; > > > > > > . This can be found around line 251 of tetgen_io.C (version 0.7.1). > > > Here, I just added > > > > > > roberts_region.push_back(dummy); > > > > > > Now, I just have to create an object TetGenIO TETGEN when reading the > > > mesh and with TETGEN.roberts_region.at(...) I can get my attributes. > > > I do this immediately after reading the mesh and before any refinement. > > > > > > This is maybe not the most elegant way to do it. However, it seems to > > > work. > > > > I just checked in something similar but slightly more general in that > > it will read multiple attributes per element as well as node > > attributes. > > > > They are stored in the public members "element_attributes" and > > "node_attributes" respectively, which are vector<vector<Real> >'s. > > > > Here's some test code you can try out, it seemed to work fine with the > > mesh file you sent me... > > > > // Manual IO object creation. We need to use this if > > // we want the attributes to hang around after the reading is finished... > > TetGenIO t(mesh); > > t.read(filename); > > > > unsigned n_elem_attributes = t.element_attributes.size(); > > unsigned n_node_attributes = t.node_attributes.size(); > > > > // Assign subdomain IDs based on the read in element attributes > > if (n_elem_attributes == 1) > > { > > MeshBase::element_iterator it = mesh.elements_begin(); > > const MeshBase::element_iterator end = mesh.elements_end(); > > unsigned ctr=0; > > for ( ; it != end; ++it, ctr++) > > { > > Elem* elem = *it; > > > > // Assign the subdomain ID from t.element_attributes[0] > > elem->subdomain_id() = > > static_cast<subdomain_id_type>(t.element_attributes[0][ctr]); > > } // end loop over elements > > } // end if n_elem_attributes > > > > // Write out the mesh in a different (Exodus) format > > mesh.write("tetgen_read_test.e"); > > > > > > ------------------------------------------------------------------------------ > BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA > The must-attend event for mobile developers. Connect with experts. > Get tools for creating Super Apps. See the latest technologies. > Sessions, hands-on labs, demos & much more. Register early & save! > http://p.sf.net/sfu/rim-blackberry-1 > _______________________________________________ > Libmesh-users mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libmesh-users |
From: John P. <jwp...@gm...> - 2011-08-15 14:03:38
|
On Fri, Aug 12, 2011 at 4:21 AM, robert <rob...@un...> wrote: > Hello, > > again, I have a question as far as reading meshes with tetgen is > concered. > I read a mesh by > > Mesh new_mesh; > EquationSystems new_equation_systems (new_mesh); > TetGenIO TETGEN(new_mesh); > > OStringStream inmesh; > inmesh<<"geometry_wings/export_pov/out/"<<ReadMesh[actual_pulse]<<"_box.1.ele"; > TETGEN.read(inmesh.str().c_str()); > > Afterwards, if I look at the equation system I get n_dofs() = 0; This makes sense, you haven't added any Systems to your EquationSystems object. All the n_dofs() function does is loop over the Systems stored in the EquationSystems object and add up the dofs of each... > Up to now I have looped through the nodes and > > MeshBase::node_iterator nd = mesh.nodes_begin(); > const MeshBase::node_iterator end_nd = mesh.nodes_end(); > > int proc = 0; > for ( ; nd != end_nd; ++nd){ > Node* NOD = *nd; > NOD->processor_id() = proc; > > } > > My question now is, if the code still works in parallel? Probably, but the real question is why you'd want to do this. If you are running in parallel it will almost certainly screw up the domain decomposition which has been determined by the Partitioner classes... -- John |
From: robert <rob...@un...> - 2011-08-17 09:25:51
|
Am Montag, den 15.08.2011, 08:03 -0600 schrieb John Peterson: > On Fri, Aug 12, 2011 at 4:21 AM, robert <rob...@un...> wrote: > > Hello, > > > > again, I have a question as far as reading meshes with tetgen is > > concered. > > I read a mesh by > > > > Mesh new_mesh; > > EquationSystems new_equation_systems (new_mesh); > > TetGenIO TETGEN(new_mesh); > > > > OStringStream inmesh; > > inmesh<<"geometry_wings/export_pov/out/"<<ReadMesh[actual_pulse]<<"_box.1.ele"; > > TETGEN.read(inmesh.str().c_str()); > > > > Afterwards, if I look at the equation system I get n_dofs() = 0; > > This makes sense, you haven't added any Systems to your > EquationSystems object. All the n_dofs() function does is loop over > the Systems stored in the EquationSystems object and add up the dofs > of each... > But even if I add a system I get the same: Mesh new_mesh; TetGenIO TETGEN(new_mesh); { // read TETGEN file OStringStream inmesh; inmesh<<"geometry_wings/export_pov/out/"<< ReadMesh[actual_pulse]<<"_box.1.ele"; TETGEN.read(inmesh.str().c_str()); } /// --- EquationSystems new_equation_systems (new_mesh); // set_processor_id(new_mesh,0); // manually set the processor_id new_mesh.print_info(); TransientLinearImplicitSystem & T_system = new_equation_systems.add_system<TransientLinearImplicitSystem>("Diffusion"); T_system.add_variable ("T", FIRST); T_system.attach_assemble_function (assemble_cd); T_system.attach_init_function (init_geothermal_gradient); new_equation_systems.init (); new_equation_systems.print_info(); In addition to the sample code above I have added two more systems which are explicit. With new_equation_systems.print_info() I get the following output for the System Diffusion : System "Diffusion" Type "TransientLinearImplicit" Variables="T" Finite Element Types="LAGRANGE" Approximation Orders="FIRST" n_dofs()=0 n_local_dofs()=0 n_constrained_dofs()=0 n_vectors()=3 DofMap Sparsity Average On-Processor Bandwidth = 0 Average Off-Processor Bandwidth = 0 Maximum On-Processor Bandwidth = 0 Maximum Off-Processor Bandwidth = 0 DofMap Constraints Number of Constraints = 0 > > > Up to now I have looped through the nodes and > > > > MeshBase::node_iterator nd = mesh.nodes_begin(); > > const MeshBase::node_iterator end_nd = mesh.nodes_end(); > > > > int proc = 0; > > for ( ; nd != end_nd; ++nd){ > > Node* NOD = *nd; > > NOD->processor_id() = proc; > > > > } > > > > My question now is, if the code still works in parallel? > > Probably, but the real question is why you'd want to do this. If you > are running in parallel it will almost certainly screw up the domain > decomposition which has been determined by the Partitioner classes... > Well, because if I do it then I get the following: System "Diffusion" Type "TransientLinearImplicit" Variables="T" Finite Element Types="LAGRANGE" Approximation Orders="FIRST" n_dofs()=91976 n_local_dofs()=91976 n_constrained_dofs()=0 n_vectors()=3 DofMap Sparsity Average On-Processor Bandwidth = 14.8131 Average Off-Processor Bandwidth = 0 Maximum On-Processor Bandwidth = 206 Maximum Off-Processor Bandwidth = 0 DofMap Constraints Number of Constraints = 0 Furthermore, I have another question. I recently discussed with the responsible person for the 'blue gene/p' computer which we have here at university. He told me that for libraries like Petsc they often have problems to get it work on multiple clusters. Do you have any experience with this kind of supercomputer and libmesh? The responsible professor doesn't know libmesh and this was one of the first questions he asked. Thanks a lot, Robert |
From: John P. <jwp...@gm...> - 2011-08-17 15:52:59
|
On Wed, Aug 17, 2011 at 3:25 AM, robert <rob...@un...> wrote: > Am Montag, den 15.08.2011, 08:03 -0600 schrieb John Peterson: >> On Fri, Aug 12, 2011 at 4:21 AM, robert <rob...@un...> wrote: >> > Hello, >> > >> > again, I have a question as far as reading meshes with tetgen is >> > concered. >> > I read a mesh by >> > >> > Mesh new_mesh; >> > EquationSystems new_equation_systems (new_mesh); >> > TetGenIO TETGEN(new_mesh); >> > >> > OStringStream inmesh; >> > inmesh<<"geometry_wings/export_pov/out/"<<ReadMesh[actual_pulse]<<"_box.1.ele"; >> > TETGEN.read(inmesh.str().c_str()); >> > >> > Afterwards, if I look at the equation system I get n_dofs() = 0; >> >> This makes sense, you haven't added any Systems to your >> EquationSystems object. All the n_dofs() function does is loop over >> the Systems stored in the EquationSystems object and add up the dofs >> of each... >> > > But even if I add a system I get the same: You'll need to add a call to mesh.prepare_for_use() some time before the EquationSystems init() call. We could probably do this automatically in the IO classes but for the most part we don't, one reason is to let the user control whether libmesh renumber the nodes and elements or not... > Furthermore, I have another question. I recently discussed with the > responsible person for the 'blue gene/p' computer which we have here at > university. He told me that for libraries like Petsc they often have > problems to get it work on multiple clusters. Do you have any experience > with this kind of supercomputer and libmesh? The responsible professor > doesn't know libmesh and this was one of the first questions he asked. Pretty sure PETSc works just fine on Blue Gene, but none of the primary libmesh developers has ever had access to one to ensure that libmesh compiles there. Chances are good if PETSc is already working and they have a modern C++ compiler... -- John |