FrontISTR 5.2.0
Large-scale structural analysis program with finit element method
Loading...
Searching...
No Matches
hecmw_io_get_mesh_if.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_dist_free.h"
11#include "hecmw_io_get_mesh.h"
12#include "hecmw_dist_copy_c2f.h"
13
14static struct hecmwST_local_mesh *mesh;
15
16void hecmw_get_mesh_init_if(char *name_ID, int *err, int len) {
17 char cname[HECMW_FILENAME_LEN + 1];
18
19 if (HECMW_strcpy_f2c_r(name_ID, len, cname, sizeof(cname)) == NULL) {
20 *err = 1;
21 return;
22 }
23
24 mesh = HECMW_get_mesh(cname);
25 if (mesh == NULL) {
26 *err = 1;
27 return;
28 }
29
30 if (HECMW_dist_copy_c2f_init(mesh)) {
31 *err = 1;
32 return;
33 }
34
35 *err = 0;
36}
37
38void hecmw_get_mesh_init_if_(char *name_ID, int *err, int len) {
39 hecmw_get_mesh_init_if(name_ID, err, len);
40}
41
42void hecmw_get_mesh_init_if__(char *name_ID, int *err, int len) {
43 hecmw_get_mesh_init_if(name_ID, err, len);
44}
45
46void HECMW_GET_MESH_INIT_IF(char *name_ID, int *err, int len) {
47 hecmw_get_mesh_init_if(name_ID, err, len);
48}
49
50/*----------------------------------------------------------------------------*/
51
54 *ierr = 1;
55 return;
56 }
57 HECMW_dist_free(mesh);
58 mesh = NULL;
59 *ierr = 0;
60}
61
64}
65
68}
69
#define HECMW_FILENAME_LEN
Definition: hecmw_config.h:72
int HECMW_dist_copy_c2f_init(struct hecmwST_local_mesh *local_mesh)
int HECMW_dist_copy_c2f_finalize(void)
void HECMW_dist_free(struct hecmwST_local_mesh *mesh)
struct hecmwST_local_mesh * HECMW_get_mesh(char *name_ID)
void hecmw_get_mesh_finalize_if(int *ierr)
void HECMW_GET_MESH_INIT_IF(char *name_ID, int *err, int len)
void HECMW_GET_MESH_FINALIZE_IF(int *ierr)
void hecmw_get_mesh_finalize_if_(int *ierr)
void hecmw_get_mesh_init_if__(char *name_ID, int *err, int len)
void hecmw_get_mesh_init_if_(char *name_ID, int *err, int len)
void hecmw_get_mesh_finalize_if__(int *ierr)
void hecmw_get_mesh_init_if(char *name_ID, int *err, int len)
#define NULL
char * HECMW_strcpy_f2c_r(const char *fstr, int flen, char *buf, int bufsize)
Definition: hecmw_lib_fc.c:45