FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
hecmw_io_put_mesh.c
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2019 FrontISTR Commons
3  * This software is released under the MIT License, see LICENSE.txt
4  *****************************************************************************/
5 
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include "hecmw_struct.h"
9 #include "hecmw_util.h"
10 #include "hecmw_io_put_mesh.h"
11 #include "hecmw_io_dist.h"
12 
13 int HECMW_put_mesh(struct hecmwST_local_mesh *mesh, char *name_ID) {
14  struct hecmw_ctrl_meshfile *file;
15  struct hecmw_ctrl_meshfiles *files;
16  char filename[HECMW_FILENAME_LEN + 1];
17 
18  files = HECMW_ctrl_get_meshfiles(name_ID);
19  if (files == NULL) return -1;
20 
21  file = &files->meshfiles[0];
22 
23  strcpy(filename, files->meshfiles[0].filename);
24  if (HECMW_put_dist_mesh(mesh, filename)) return -1;
25 
27 
28  return 0;
29 }
mesh
struct hecmwST_local_mesh * mesh
Definition: hecmw_repart.h:71
hecmwST_local_mesh
Definition: hecmw_struct.h:139
hecmw_struct.h
hecmw_io_put_mesh.h
hecmw_io_dist.h
hecmw_ctrl_meshfile
Definition: hecmw_control.h:11
HECMW_put_dist_mesh
int HECMW_put_dist_mesh(const struct hecmwST_local_mesh *mesh, char *fname)
Definition: hecmw_io_dist.c:2767
HECMW_ctrl_free_meshfiles
void HECMW_ctrl_free_meshfiles(struct hecmw_ctrl_meshfiles *meshfiles)
Definition: hecmw_control.c:2066
HECMW_ctrl_get_meshfiles
struct hecmw_ctrl_meshfiles * HECMW_ctrl_get_meshfiles(char *name_ID)
Definition: hecmw_control.c:2205
hecmw_ctrl_meshfiles
Definition: hecmw_control.h:39
hecmw_ctrl_meshfile::filename
char * filename
Definition: hecmw_control.h:34
hecmw_ctrl_meshfiles::meshfiles
struct hecmw_ctrl_meshfile * meshfiles
Definition: hecmw_control.h:42
NULL
#define NULL
Definition: hecmw_io_nastran.c:30
HECMW_FILENAME_LEN
#define HECMW_FILENAME_LEN
Definition: hecmw_config.h:72
hecmw_util.h
HECMW_put_mesh
int HECMW_put_mesh(struct hecmwST_local_mesh *mesh, char *name_ID)
Definition: hecmw_io_put_mesh.c:13