Gmsh support on Deal.II Virtualbox image

64 views
Skip to first unread message

husain.u...@gmail.com

unread,
Dec 15, 2020, 1:21:00 PM12/15/20
to deal.II User Group

Hello Deal.II community,
I am working on deal.II via the VM image (release 9.1.1). I am having trouble reading the .msh file. I even tried running running step 49 and received this error:

----------------------------------------------------
Exception on processing:

--------------------------------------------------------
An error occurred in line <1408> of file </home/ubuntu/deal.II/dealii/source/grid/grid_in.cc> in function
    void dealii::GridIn<dim, spacedim>::read_msh(std::istream&) [with int dim = 2; int spacedim = 2; std::istream = std::basic_istream<char>]
The violated condition was:
    in
Additional information:
    An input/output error has occurred. There are a number of reasons why this may be happening, both for reading and writing operations.

If this happens during an operation that tries to read data: First, you may be trying to read from a file that doesn't exist or that is not readable given its file permissions. Second, deal.II uses this error at times if it tries to read information from a file but where the information in the file does not correspond to the expected format. An example would be a truncated file, or a mesh file that contains not only sections that describe the vertices and cells, but also sections for additional data that deal.II does not understand.

If this happens during an operation that tries to write data: you may be trying to write to a file to which file or directory permissions do not allow you to write. A typical example is where you specify an output file in a directory that does not exist.
--------------------------------------------------------

Aborting!
----------------------------------------------------

I checked the detailed.log file and found DEAL_II_WITH_GMSH is OFF. 
I also tried to install the latest version of gmsh (4.7.1) and ran the cmake command for deal ii installation with -DGMSH_DIR=/path/to/gmsh added to it. But it gives me warning

CMake Warning:
  Manually-specified variables were not used by the project:

    GMSH_DIR

Can someone please suggest if I am missing anything here?

Aaditya Lakshmanan

unread,
Dec 15, 2020, 1:47:48 PM12/15/20
to deal.II User Group
Hi,
  You probably also need to supply the flag -DDEAL_II_WITH_GMSH=ON in the cmake line.

Best,
Aaditya

Timo Heister

unread,
Dec 15, 2020, 3:56:49 PM12/15/20
to dea...@googlegroups.com
This has nothing to do with DEAL_II_WITH_GMSH. That feature is only
required if you use functionality from the Gmsh namespace
(https://www.dealii.org/developer/doxygen/deal.II/namespaceGmsh.html).
The error message

The violated condition was:
in
Additional information:
An input/output error has occurred.

occurs when the .msh file is not found. Does the file exist in the
current folder?
> --
> 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 the Google Groups "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/202c8f45-053c-4f34-a71b-e8cdf7ddbfa2n%40googlegroups.com.



--
Timo Heister
http://www.math.clemson.edu/~heister/

Wolfgang Bangerth

unread,
Dec 15, 2020, 3:59:44 PM12/15/20
to dea...@googlegroups.com

> I am working on deal.II via the VM image (release 9.1.1). I am having trouble
> reading the .msh file. I even tried running running step 49 and received this
> error:

I believe that's because we forgot to include two files in the release. Does
this here help?
https://groups.google.com/g/dealii/c/ZtgMynOTx38/m/RsTGxUHqBgAJ

Best
W.

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

husain.u...@gmail.com

unread,
Dec 16, 2020, 2:26:30 AM12/16/20
to deal.II User Group
Dear all, thanx for the immediate support. Turns out Professor Heister was right. I am using an IDE CLion, and I still dont understand everything in it. I moved my .msh file to the cmake-build-debug folder (created when I run my project using that IDE) and was able to read it.
Regards
Umair
Reply all
Reply to author
Forward
0 new messages