# Can not read elements when using ComponentElmer

**URL:** <https://root-forum.cern.ch/t/can-not-read-elements-when-using-componentelmer/51031>\
**Category:** Garfield++\
**Created:** [July 31, 2022, 2:08pm UTC](https://root-forum.cern.ch/t/can-not-read-elements-when-using-componentelmer/51031 "2022-07-31T14:08:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crisps](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/crisps/32/39101_2.png) [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Post date:** [July 31, 2022, 2:08pm UTC](https://root-forum.cern.ch/t/can-not-read-elements-when-using-componentelmer/51031/1 "2022-07-31T14:08:27Z")

</div>

Dear Experts

I calculated an electric field map using Gmsh and ElmerSolver, and want to import it into Garfield++. I got an error when reading the elements but I don’t know what does it mean.  
My code:

```auto
fCompE_field = new ComponentElmer(
            "fieldmap/prototype/mesh.header", "fieldmap/prototype/mesh.elements", "fieldmap/prototype/mesh.nodes",
            "fieldmap/prototype/dielectrics.dat", "fieldmap/prototype/prototype.result", "mm");

```

And I got such output:

```auto
ComponentElmer::Initialise:
    Read 568725 nodes and 3529037 elements from file fieldmap/prototype/mesh.header.
ComponentElmer::Initialise:
    Set material 0 of 10 to eps 1e+10.
ComponentElmer::Initialise:
    Set material 1 of 10 to eps 1e+10.
ComponentElmer::Initialise:
    Set material 2 of 10 to eps 1e+10.
ComponentElmer::Initialise:
    Set material 3 of 10 to eps 1e+10.
ComponentElmer::Initialise:
    Set material 4 of 10 to eps 1e+10.
ComponentElmer::Initialise:
    Set material 5 of 10 to eps 1e+10.
ComponentElmer::Initialise:
    Set material 6 of 10 to eps 1e+10.
ComponentElmer::Initialise:
    Set material 7 of 10 to eps 1e+10.
ComponentElmer::Initialise:
    Set material 8 of 10 to eps 1e+10.
ComponentElmer::Initialise:
    Set material 9 of 10 to eps 1.
ComponentElmer::Initialise:
    Error reading file fieldmap/prototype/mesh.elements (line 0).

```

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [August 1, 2022, 6:42am UTC](https://root-forum.cern.ch/t/can-not-read-elements-when-using-componentelmer/51031/2 "2022-08-01T06:42:44Z")

</div>

Can you provide the field map files you are using?

---

<div class="post-metadata">

**Author:** ![Crisps](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/crisps/32/39101_2.png) [@Crisps](https://root-forum.cern.ch/u/Crisps)\
**Post date:** [August 1, 2022, 6:59am UTC](https://root-forum.cern.ch/t/can-not-read-elements-when-using-componentelmer/51031/3 "2022-08-01T06:59:41Z")

</div>

@hschindl It’s just too large…(100MB after compress) so I put on google drive.

> **[prototype.zip](https://drive.google.com/file/d/17-F5IE7R9QfAF6glDCHBFUshs_89xlpd/view?usp=sharing)**
>
> Google Drive file.

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [August 1, 2022, 7:27am UTC](https://root-forum.cern.ch/t/can-not-read-elements-when-using-componentelmer/51031/4 "2022-08-01T07:27:43Z")

</div>

Your `mesh.elements` file is for a linear tetrahedral mesh (four nodes per element). `ComponentElmer` expects a second-order tetrahedral mesh (ten nodes per element).

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [August 15, 2022, 7:27am UTC](https://root-forum.cern.ch/t/can-not-read-elements-when-using-componentelmer/51031/5 "2022-08-15T07:27:50Z")

</div>

Closed on August 15, 2022, 7:27am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
