[Dune] gmsh mesh loading using dune-uggrid

Simon Praetorius Simon.Praetorius at tu-dresden.de
Tue Apr 25 11:50:57 CEST 2017


You could use a GridFactory to actually create your grid from a  
corresponding reader:

```
using Grid = Dune::UGGrid<dim>;

Dune::GridFactory<Grid> gridFactory;
Dune::GmshReader<Grid>::read(gridFactory, filename);
std::unique_ptr<Grid> grid( gridFactory.createGrid() );
```

Simon


Zitat von "Stary, Tomas" <T.Stary at exeter.ac.uk>:

> Hi,
>
> Thanks, the updating of the dune-grit repository has been helpful.  I
> have been able to compile the code including the required header
> files.
>
> I am now trying to initialise the uggrid with the following code:
>
>       typedef Dune::UGGrid<dim> GRID;
>       GRID grid;
>
> During the compilation I get a linking error:
>
> CMakeFiles/dune-poroelastic.dir/dune-poroelastic.cc.o: In function `main':
> /home/tom/Work/dune/dune-poroelastic/src/dune-poroelastic.cc:34:  
> undefined reference to `Dune::UGGrid<3>::UGGrid()'
> /home/tom/Work/dune/dune-poroelastic/src/dune-poroelastic.cc:34:  
> undefined reference to `Dune::UGGrid<3>::~UGGrid()'
> collect2: error: ld returned 1 exit status
>
> Is there any other way of initialising the UGGrid?
>
> Thank you,
>
> Tomas
>
> On Mon, Apr 24, 2017 at 11:09:48AM +0100, Stary, Tomas wrote:
>> Hi,
>>
>> I would like to load a mesh created in gmsh program into dune using
>> dune-uggrid module. For that I have created a new project dependent on
>> dune-uggrid and included required header files to the project:
>>
>> #include <dune/grid/uggrid.hh>
>> #include <dune/grid/common/gridfactory.hh>
>> #include <dune/grid/common/gridinfo.hh>
>>
>> When I try to compile the code I get the following error:
>>
>> /home/tom/Work/dune/dune-grid/dune/grid/uggrid/ugwrapper.hh: In  
>> static member function 'static UG::DOUBLE  
>> Dune::UG_NS<2>::SurfaceElement(int, const DOUBLE (*)[2], const  
>> DOUBLE*)':
>> /home/tom/Work/dune/dune-grid/dune/grid/uggrid/ugwrapper.hh:876:11:  
>> error: 'SurfaceElement' is not a member of 'UG::D2'
>>        if (UG_NAMESPACE ::SurfaceElement(UG_DIM, nc, co_global,  
>> ip_local, &result))
>>
>> I am using a Linux machine, the same configuration works fine with a
>> different version of uggrid on Mac.
>>
>> Do you have any suggestions on how to get over this issue, please?
>>
>> Many thanks,
>>
>> Tomas
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune



-- 
Dr. Simon Praetorius
Institut für Wissenschaftliches Rechnen
Fachrichtung Mathematik
Technische Universität Dresden
Tel.: TUD-42377
Mail: simon.praetorius at tu-dresden.de
Web: www.math.tu-dresden.de/~spraetor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5733 bytes
Desc: S/MIME-Signatur
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20170425/45512c92/attachment.bin>


More information about the Dune mailing list