how to create mesh.names

Numerical methods and mathematical models of Elmer
Post Reply
Guo
Posts: 6
Joined: 01 Aug 2022, 15:22
Antispam: Yes

how to create mesh.names

Post by Guo »

Hello,

I am trying to run elmer via python. when I finish the mesh, I want to run ElmerSolver to generate the .vtu file, but I get this error:"ERROR:: ReadTargetNames: Requested the use of entity names but this file does not exits: ./mesh.names"

I can see the mesh.names when I write Elmer in FreeCAD, but not when I run it in python.

I want to know how can I get mesh.names? Thanks!

Here is my python code.

Code: Select all

from subprocess import call

GMSH_Path = "C:/Users/86138/fc_env_py39/Library/bin/gmsh.exe"
ELMER_GRID_PATH = "D:/Elmer/Elmer 9.0-Release/bin/ElmerGrid.exe"
ELMER_PATH = "D:/Elmer/Elmer 9.0-Release/bin/ElmerSolver.exe"

call([GMSH_Path, "D:/senior year/Bachelor/220601_B_GUO/devel/src/pythonProject/Model_Bone/tube-myTube.step", "-3", "-optimize_netgen", "-format", "msh2", "-save_all", "-o", "mesh.msh"])
call([ELMER_GRID_PATH, "14", "2", "-in", "mesh.msh", "-autoclean", "-out", "D:/senior year/Bachelor/220601_B_GUO/devel/src/pythonProject/FEM Results/tube"])
call([ELMER_GRID_PATH, "2", "4", "mesh"])
call([ELMER_PATH, "case.sif"])

Starting program Elmergrid
Elmergrid reading in-line arguments
Lower dimensional boundaries will be removed
Materials and boundaries will be renumbered
Nodes that do not appear in any element will be removed
Output will be saved to file D:/senior year/Bachelor/220601_B_GUO/devel/src/pythonProject/FEM Results/tube.

Elmergrid loading data:
-----------------------
LoadGmshInput: The opening of the mesh file -in.msh failed!

Thank you for using Elmergrid!
Send bug reports and feature wishes to elmeradm@csc.fi

Starting program Elmergrid
Elmergrid reading in-line arguments
Output will be saved to file mesh.

Elmergrid loading data:
-----------------------
Loading mesh in ElmerSolver format from root directory.
Loading header from mesh.header
Maximum elementtype index is: 504
Maximum number of nodes in element is: 4
Allocating for 198 knots and 570 elements.
Loading 198 Elmer nodes from mesh.nodes
Loading 570 bulk elements from mesh.elements
Loading 290 boundary elements from mesh.boundary
Elmer mesh loaded successfully

Elmergrid creating and manipulating meshes:
-------------------------------------------

Elmergrid saving data with method 4:
-------------------------------------
Saving Gmsh mesh to mesh.msh.
Saving 198 node coordinates.
Saving 570 element topologies.
SaveMeshGmsh: All done

Thank you for using Elmergrid!
Send bug reports and feature wishes to elmeradm@csc.fi
ELMER SOLVER (v 9.0) STARTED AT: 2022/08/16 17:18:39
ParCommInit: Initialize #PEs: 1
MAIN:
MAIN: =============================================================
MAIN: ElmerSolver finite element software, Welcome!
MAIN: This program is free software licensed under (L)GPL
MAIN: Copyright 1st April 1995 - , CSC - IT Center for Science Ltd.
MAIN: Webpage http://www.csc.fi/elmer, Email elmeradm@csc.fi
MAIN: Version: 9.0 (Rev: Release, Compiled: 2022-06-15)
MAIN: Running one task without MPI parallelization.
MAIN: Running with just one thread per task.
MAIN: Lua interpreter linked in.
MAIN: =============================================================
MAIN:
MAIN:
MAIN: -------------------------------------
MAIN: Reading Model: case.sif
LoadInputFile: Scanning input file: case.sif
LoadInputFile: Scanning only size info
LoadInputFile: First time visiting
LoadInputFile: Reading base load of sif file
LoadInputFile: Loading input file: case.sif
LoadInputFile: Reading base load of sif file
LoadInputFile: Number of BCs: 2
LoadInputFile: Number of Body Forces: 0
LoadInputFile: Number of Initial Conditions: 0
LoadInputFile: Number of Materials: 1
LoadInputFile: Number of Equations: 1
LoadInputFile: Number of Solvers: 2
LoadInputFile: Number of Bodies: 1
ListTagKeywords: Setting weight for keywords!
ListTagKeywords: No parameters width suffix: normalize by area
ListTagKeywords: Setting weight for keywords!
ListTagKeywords: No parameters width suffix: normalize by volume
Loading user function library: [StressSolve]...[StressSolver_Init0]
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver_Init0]
LoadMesh: Loading serial mesh!
ElmerAsciiMesh: Performing step: 1
ElmerAsciiMesh: Base mesh name: .
ReadHeaderFile: Reading header info from file: ./mesh.header
InitializeMesh: Number of nodes in mesh: 198
InitializeMesh: Number of bulk elements in mesh: 570
InitializeMesh: Number of boundary elements in mesh: 290
InitializeMesh: Initial number of max element nodes: 4
ElmerAsciiMesh: Performing step: 2
ReadNodesFile: Reading nodes from file: ./mesh.nodes
MapCoordinates: Performing coordinate mapping
SetMeshDimension: Dimension of mesh is: 3
SetMeshDimension: Max dimension of mesh is: 3
ElmerAsciiMesh: Performing step: 3
ReadElementsFile: Reading bulk elements from file: ./mesh.elements
ElmerAsciiMesh: Performing step: 4
ReadBoundaryFile: Reading boundary elements from file: ./mesh.boundary
PermuteNodeNumbering: Performing node mapping
ERROR:: ReadTargetNames: Requested the use of entity names but this file does not exits: ./mesh.names
STOP 1

Process finished with exit code 0
Attachments
case.sif
(2.1 KiB) Downloaded 77 times
mesh.msh
(29.4 KiB) Downloaded 78 times
Post Reply