// File: npaster[P]gmsh_tools/gmshData.cpp
// Function: gmsh::ElementData::writeElementData(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>) const
void
ElementData::writeElementData(const std::string name_mesh) const
{
   std::ofstream mesh_file;
   mesh_file.open(name_mesh, std::ofstream::out | std::ofstream::app);
   if (!mesh_file.is_open()) {
      std::cout << "Unable to open file " << name_mesh << std::endl;
      abort();
   } else {
      std::cout << "------------------------" << std::endl;
      std::cout << "Writing Results " << name_mesh << std::endl;
      std::cout << "MSH ASCII file format" << std::endl;
      std::cout << "------------------------" << std::endl;
   }

   mesh_file << "$ElementData" << std::endl;
   mesh_file << 1 << std::endl; // string tag

   mesh_file << "\" " << m_title << "\" " << std::endl; // name of the view
   mesh_file << 1 << std::endl;                         // real tag
   mesh_file << m_time_value << std::endl;              // time value
   mesh_file << 3 << std::endl;                         // integer tag
   mesh_file << 0 << std::endl;                         // time Step

   mesh_file << m_composante << std::endl;
   mesh_file << m_datas.size() << std::endl;

   for (size_t i = 0; i < m_datas.size(); i++) {
      mesh_file << m_datas[i].getIndex() << " ";

      std::vector<double> tmpresu(m_datas[i].getData());
      for (size_t j = 0; j < std::min(m_composante, tmpresu.size()); j++) {
         mesh_file << tmpresu[j] << " ";
      }
      for (size_t j = std::min(m_composante, tmpresu.size()); j < m_composante; j++) {
         mesh_file << 0.0 << " ";
      }

      mesh_file << std::endl;
   }

   mesh_file << "$EndElementData" << std::endl;
   mesh_file.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x350, %rsp            # imm = 0x350
movq %rsi, -0x278(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x270(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x22c0
movl $0x10, %edi
movl $0x1, %esi
callq 0x1be30
movl %eax, -0x264(%rbp)
jmp 0x1a708
movl -0x264(%rbp), %edx
movq -0x278(%rbp), %rsi
leaq -0x210(%rbp), %rdi
callq 0x20e0
jmp 0x1a723
leaq -0x210(%rbp), %rdi
callq 0x2140
movb %al, -0x279(%rbp)
jmp 0x1a737
movb -0x279(%rbp), %al
testb $0x1, %al
jne 0x1a7ac
jmp 0x1a743
movq 0x1688e(%rip), %rdi     # 0x30fd8
leaq 0x7091(%rip), %rsi      # 0x217e2
callq 0x21b0
movq %rax, -0x288(%rbp)
jmp 0x1a75f
movq -0x278(%rbp), %rsi
movq -0x288(%rbp), %rdi
callq 0x2190
movq %rax, -0x290(%rbp)
jmp 0x1a77b
movq -0x290(%rbp), %rdi
movq 0x1683f(%rip), %rsi     # 0x30fc8
callq 0x21e0
jmp 0x1a790
callq 0x2110
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x1ad36
movq 0x16825(%rip), %rdi     # 0x30fd8
leaq 0x68b1(%rip), %rsi      # 0x2106b
callq 0x21b0
movq %rax, -0x298(%rbp)
jmp 0x1a7c8
movq -0x298(%rbp), %rdi
movq 0x167f2(%rip), %rsi     # 0x30fc8
callq 0x21e0
jmp 0x1a7dd
movq 0x167f4(%rip), %rdi     # 0x30fd8
leaq 0x7728(%rip), %rsi      # 0x21f13
callq 0x21b0
movq %rax, -0x2a0(%rbp)
jmp 0x1a7f9
movq -0x278(%rbp), %rsi
movq -0x2a0(%rbp), %rdi
callq 0x2190
movq %rax, -0x2a8(%rbp)
jmp 0x1a815
movq -0x2a8(%rbp), %rdi
movq 0x167a5(%rip), %rsi     # 0x30fc8
callq 0x21e0
jmp 0x1a82a
movq 0x167a7(%rip), %rdi     # 0x30fd8
leaq 0x73ef(%rip), %rsi      # 0x21c27
callq 0x21b0
movq %rax, -0x2b0(%rbp)
jmp 0x1a846
movq -0x2b0(%rbp), %rdi
movq 0x16774(%rip), %rsi     # 0x30fc8
callq 0x21e0
jmp 0x1a85b
movq 0x16776(%rip), %rdi     # 0x30fd8
leaq 0x6802(%rip), %rsi      # 0x2106b
callq 0x21b0
movq %rax, -0x2b8(%rbp)
jmp 0x1a877
movq -0x2b8(%rbp), %rdi
movq 0x16743(%rip), %rsi     # 0x30fc8
callq 0x21e0
jmp 0x1a88c
jmp 0x1a88e
leaq 0x76a6(%rip), %rsi      # 0x21f3b
leaq -0x210(%rbp), %rdi
callq 0x21b0
movq %rax, -0x2c0(%rbp)
jmp 0x1a8aa
movq -0x2c0(%rbp), %rdi
movq 0x16710(%rip), %rsi     # 0x30fc8
callq 0x21e0
jmp 0x1a8bf
leaq -0x210(%rbp), %rdi
movl $0x1, %esi
callq 0x22d0
movq %rax, -0x2c8(%rbp)
jmp 0x1a8d9
movq -0x2c8(%rbp), %rdi
movq 0x166e1(%rip), %rsi     # 0x30fc8
callq 0x21e0
jmp 0x1a8ee
leaq 0x761b(%rip), %rsi      # 0x21f10
leaq -0x210(%rbp), %rdi
callq 0x21b0
movq %rax, -0x2d0(%rbp)
jmp 0x1a90a
movq -0x2d0(%rbp), %rdi
movq -0x270(%rbp), %rsi
addq $0x10, %rsi
callq 0x2190
movq %rax, -0x2d8(%rbp)
jmp 0x1a92a
movq -0x2d8(%rbp), %rdi
leaq 0x75d8(%rip), %rsi      # 0x21f10
callq 0x21b0
movq %rax, -0x2e0(%rbp)
jmp 0x1a946
movq -0x2e0(%rbp), %rdi
movq 0x16674(%rip), %rsi     # 0x30fc8
callq 0x21e0
jmp 0x1a95b
leaq -0x210(%rbp), %rdi
movl $0x1, %esi
callq 0x22d0
movq %rax, -0x2e8(%rbp)
jmp 0x1a975
movq -0x2e8(%rbp), %rdi
movq 0x16645(%rip), %rsi     # 0x30fc8
callq 0x21e0
jmp 0x1a98a
movq -0x270(%rbp), %rax
movsd 0x8(%rax), %xmm0
leaq -0x210(%rbp), %rdi
callq 0x2320
movq %rax, -0x2f0(%rbp)
jmp 0x1a9ab
movq -0x2f0(%rbp), %rdi
movq 0x1660f(%rip), %rsi     # 0x30fc8
callq 0x21e0
jmp 0x1a9c0
leaq -0x210(%rbp), %rdi
movl $0x3, %esi
callq 0x22d0
movq %rax, -0x2f8(%rbp)
jmp 0x1a9da
movq -0x2f8(%rbp), %rdi
movq 0x165e0(%rip), %rsi     # 0x30fc8
callq 0x21e0
jmp 0x1a9ef
leaq -0x210(%rbp), %rdi
xorl %esi, %esi
callq 0x22d0
movq %rax, -0x300(%rbp)
jmp 0x1aa06
movq -0x300(%rbp), %rdi
movq 0x165b4(%rip), %rsi     # 0x30fc8
callq 0x21e0
jmp 0x1aa1b
movq -0x270(%rbp), %rax
movq (%rax), %rsi
leaq -0x210(%rbp), %rdi
callq 0x2060
movq %rax, -0x308(%rbp)
jmp 0x1aa3a
movq -0x308(%rbp), %rdi
movq 0x16580(%rip), %rsi     # 0x30fc8
callq 0x21e0
jmp 0x1aa4f
movq -0x270(%rbp), %rdi
addq $0x30, %rdi
callq 0x1be50
movq %rax, %rsi
leaq -0x210(%rbp), %rdi
callq 0x2060
movq %rax, -0x310(%rbp)
jmp 0x1aa77
movq -0x310(%rbp), %rdi
movq 0x16543(%rip), %rsi     # 0x30fc8
callq 0x21e0
jmp 0x1aa8c
movq $0x0, -0x228(%rbp)
movq -0x270(%rbp), %rdi
movq -0x228(%rbp), %rax
movq %rax, -0x318(%rbp)
addq $0x30, %rdi
callq 0x1be50
movq %rax, %rcx
movq -0x318(%rbp), %rax
cmpq %rcx, %rax
jae 0x1ace2
movq -0x270(%rbp), %rdi
addq $0x30, %rdi
movq -0x228(%rbp), %rsi
callq 0x1bea0
movq %rax, %rdi
callq 0x192b0
movq %rax, %rsi
leaq -0x210(%rbp), %rdi
callq 0x2060
movq %rax, -0x320(%rbp)
jmp 0x1aaff
movq -0x320(%rbp), %rdi
leaq 0x73f1(%rip), %rsi      # 0x21efe
callq 0x21b0
jmp 0x1ab14
movq -0x270(%rbp), %rdi
addq $0x30, %rdi
movq -0x228(%rbp), %rsi
callq 0x1bea0
movq %rax, %rsi
leaq -0x240(%rbp), %rdi
callq 0x19280
jmp 0x1ab3c
movq $0x0, -0x248(%rbp)
movq -0x248(%rbp), %rax
movq %rax, -0x330(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x1b7f0
movq -0x270(%rbp), %rdi
movq %rax, -0x250(%rbp)
leaq -0x250(%rbp), %rsi
callq 0x4880
movq %rax, -0x328(%rbp)
jmp 0x1ab84
movq -0x330(%rbp), %rax
movq -0x328(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x1ac14
movq -0x248(%rbp), %rsi
leaq -0x240(%rbp), %rdi
callq 0x1bec0
movsd (%rax), %xmm0
leaq -0x210(%rbp), %rdi
callq 0x2320
movq %rax, -0x338(%rbp)
jmp 0x1abc3
movq -0x338(%rbp), %rdi
leaq 0x732d(%rip), %rsi      # 0x21efe
callq 0x21b0
jmp 0x1abd8
jmp 0x1abda
movq -0x248(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x248(%rbp)
jmp 0x1ab47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x1ba60
jmp 0x1ad36
leaq -0x240(%rbp), %rdi
callq 0x1b7f0
movq -0x270(%rbp), %rdi
movq %rax, -0x260(%rbp)
leaq -0x260(%rbp), %rsi
callq 0x4880
movq %rax, -0x340(%rbp)
jmp 0x1ac43
movq -0x340(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x258(%rbp)
movq -0x270(%rbp), %rcx
movq -0x258(%rbp), %rax
cmpq (%rcx), %rax
jae 0x1acaa
leaq -0x210(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0x2320
movq %rax, -0x348(%rbp)
jmp 0x1ac7f
movq -0x348(%rbp), %rdi
leaq 0x7271(%rip), %rsi      # 0x21efe
callq 0x21b0
jmp 0x1ac94
jmp 0x1ac96
movq -0x258(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x258(%rbp)
jmp 0x1ac54
movq 0x16317(%rip), %rsi     # 0x30fc8
leaq -0x210(%rbp), %rdi
callq 0x21e0
jmp 0x1acbf
leaq -0x240(%rbp), %rdi
callq 0x1ba60
movq -0x228(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x228(%rbp)
jmp 0x1aa97
leaq 0x725f(%rip), %rsi      # 0x21f48
leaq -0x210(%rbp), %rdi
callq 0x21b0
movq %rax, -0x350(%rbp)
jmp 0x1acfe
movq -0x350(%rbp), %rdi
movq 0x162bc(%rip), %rsi     # 0x30fc8
callq 0x21e0
jmp 0x1ad13
leaq -0x210(%rbp), %rdi
callq 0x2240
jmp 0x1ad21
leaq -0x210(%rbp), %rdi
callq 0x2260
addq $0x350, %rsp            # imm = 0x350
popq %rbp
retq
leaq -0x210(%rbp), %rdi
callq 0x2260
movq -0x218(%rbp), %rdi
callq 0x22e0
nop