how to set the boundary name day and output to the file.

67 views
Skip to first unread message

ztdep...@gmail.com

unread,
Oct 28, 2022, 6:37:03 AM10/28/22
to deal.II User Group
I am running the first example "first_grid". I want to know does deal.ii support the defination of the boundary name and output  it to a readable file. 
I have output the grid to ucd  file , but no boundary infors are stored in the ucd file. 
 Could you please give me some advices.

Wolfgang Bangerth

unread,
Oct 28, 2022, 10:41:08 AM10/28/22
to dea...@googlegroups.com
On 10/28/22 04:37, ztdep...@gmail.com wrote:
> **
You might want to read through the documentation of the GridOut class. There
are ways to also output boundary indicators, at least for some formats, via
the various *Flags data structures.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

ztdepyahoo

unread,
Oct 28, 2022, 11:55:05 AM10/28/22
to dea...@googlegroups.com
Thanks, how to set the 4 corner nodes coordates of  a square domain. 

---- Replied Message ----
From Wolfgang Bangerth<bang...@colostate.edu>
Date 10/28/2022 22:41
To <dea...@googlegroups.com>
Subject Re: [deal.II] how to set the boundary name day and output to the file.
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/kcEiqmBrmug/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/5f719963-7586-9676-76a5-fa371103d438%40colostate.edu.

Wolfgang Bangerth

unread,
Oct 28, 2022, 12:30:02 PM10/28/22
to dea...@googlegroups.com
On 10/28/22 09:54, ztdepyahoo wrote:
> Thanks, how to set the 4 corner nodes coordates of  a square domain.

This is too short of a question. You've got to be more clear about what
you're asking since I have no idea what the problem is :-)

ztdepyahoo

unread,
Oct 28, 2022, 12:31:50 PM10/28/22
to dea...@googlegroups.com
I want to set the boundary coordinates of the GridGenerator::hyper_cube(triangulation). 


---- Replied Message ----
From Wolfgang Bangerth<bang...@colostate.edu>
Date 10/29/2022 00:30
To <dea...@googlegroups.com>
Subject Re: [deal.II] how to set the boundary name day and output to the file.
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/kcEiqmBrmug/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.

Wolfgang Bangerth

unread,
Oct 28, 2022, 12:47:45 PM10/28/22
to dea...@googlegroups.com
On 10/28/22 10:31, ztdepyahoo wrote:
> I want to set the boundary coordinates of
> the GridGenerator::hyper_cube(triangulation).

Well, have you looked at the documentation of the function?
https://dealii.org/developer/doxygen/deal.II/namespaceGridGenerator.html#acea0cbcd68e52ce8113d1134b87de403
And at the other functions that are in that namespace, for example the
hyper_rectangle function mentioned in the documentation linked to above?

Technical Forex

unread,
Oct 28, 2022, 11:01:00 PM10/28/22
to dea...@googlegroups.com
I read in the uvn file generated by salome mesh with gridin. But it gives me the following error . Attachment please find the unv file. I couldn't find what caused the error.

terminate called after throwing an instance of 'dealii::StandardExceptions::ExcIO'
 what():   
--------------------------------------------------------
An error occurred in line <864> of file </home/ztdep/Downloads/dealii-9.4.0/source/grid/grid_in.cc> in function
   void dealii::GridIn<dim, spacedim>::read_unv(std::istream&) [with int dim = 2; int spacedim = 2; std::istream = std::basic_istream<char>]
The violated condition was:  
   in.fail() == false


Wolfgang Bangerth <bang...@colostate.edu> 于2022年10月29日周六 00:47写道:
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/kcEiqmBrmug/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
3x3.unv

ztdepyahoo

unread,
Oct 30, 2022, 12:25:08 AM10/30/22
to dea...@googlegroups.com
Thanks a lot. 
When i output the grid to vtk., I found that the coordinates is in float number, how to control the output precision .
Regards

---- Replied Message ----
[deal.II] how to set the boundary name day and output to the file.
I am running the first example "first_grid". I want to know does deal.ii support the defination of the boundary name and output  it to a readable file. 
I have output the grid to ucd  file , but no boundary infors are stored in the ucd file. 
 Could you please give me some advices.

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/kcEiqmBrmug/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.

Wolfgang Bangerth

unread,
Oct 30, 2022, 7:45:18 PM10/30/22
to dea...@googlegroups.com
On 10/28/22 21:00, Technical Forex wrote:
> I read in the uvn file generated by salome mesh with gridin. But it gives me
> the following error . Attachment please find the unv file. I couldn't find
> what caused the error.
>
> terminate called after throwing an instance of
> 'dealii::StandardExceptions::ExcIO'
>  what():
> --------------------------------------------------------
> An error occurred in line <864> of file
> </home/ztdep/Downloads/dealii-9.4.0/source/grid/grid_in.cc> in function
>    void dealii::GridIn<dim, spacedim>::read_unv(std::istream&) [with int dim
> = 2; int spacedim = 2; std::istream = std::basic_istream<char>]
> The violated condition was:
>    in.fail() == false

UNV is a terrible file format. It is, in essence, a memory dump of a program
that was written many decades ago. It is a disaster to parse because there are
so many things that can appear in these files.

Can you let SALOME export the mesh in any other format?

Wolfgang Bangerth

unread,
Oct 30, 2022, 7:46:32 PM10/30/22
to dea...@googlegroups.com
On 10/29/22 22:25, ztdepyahoo wrote:
> When i output the grid to vtk., I found that the coordinates is in float
> number, how to control the output precision .

You can just set the precision on the output stream to which you write the
information. This works in essence like this:
std::ofstream out ("my_output_file.vtk");
out.precision(16);
data_out.write_vtk(out);

I haven't tested this, but believe that it should work.
Reply all
Reply to author
Forward
0 new messages