FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
hecmw_couple_startup_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 <string.h>
9 
10 #include "hecmw_struct.h"
11 #include "hecmw_lib_fc.h"
12 
13 #include "hecmw_couple_copy_c2f.h"
14 #include "hecmw_couple_startup.h"
15 
16 static struct hecmw_couple_value *couple_value;
17 
18 /*================================================================================================*/
19 
20 extern void hecmw_couple_startup_init_if(char *boundary_id, int *err, int len) {
21  char cname[HECMW_NAME_LEN + 1];
22 
23  *err = 1;
24 
25  if (HECMW_strcpy_f2c_r(boundary_id, len, cname, sizeof(cname)) == NULL)
26  return;
27  if ((couple_value = HECMW_couple_startup(cname)) == NULL) return;
28  if (HECMW_couple_copy_c2f_init(couple_value)) return;
29 
30  *err = 0;
31 }
32 
33 extern void hecmw_couple_startup_init_if_(char *boundary_id, int *err,
34  int len) {
35  hecmw_couple_startup_init_if(boundary_id, err, len);
36 }
37 
38 extern void hecmw_couple_startup_init_if__(char *boundary_id, int *err,
39  int len) {
40  hecmw_couple_startup_init_if(boundary_id, err, len);
41 }
42 
43 extern void HECMW_COUPLE_STARTUP_INIT_IF(char *boundary_id, int *err, int len) {
44  hecmw_couple_startup_init_if(boundary_id, err, len);
45 }
46 
47 /*------------------------------------------------------------------------------------------------*/
48 
49 extern void hecmw_couple_startup_final_if(int *err) {
50  *err = 1;
51 
52  if (HECMW_couple_copy_c2f_finalize()) return;
53 
54  HECMW_couple_free_couple_value(couple_value);
55  couple_value = NULL;
56 
57  *err = 0;
58 }
59 
60 extern void hecmw_couple_startup_final_if_(int *err) {
62 }
63 
64 extern void hecmw_couple_startup_final_if__(int *err) {
66 }
67 
68 extern void HECMW_COUPLE_STARTUP_FINAL_IF(int *err) {
70 }
hecmw_couple_startup_final_if_
void hecmw_couple_startup_final_if_(int *err)
Definition: hecmw_couple_startup_if.c:60
HECMW_couple_copy_c2f_init
int HECMW_couple_copy_c2f_init(struct hecmw_couple_value *_couple_value)
Definition: hecmw_couple_copy_c2f.c:138
HECMW_COUPLE_STARTUP_INIT_IF
void HECMW_COUPLE_STARTUP_INIT_IF(char *boundary_id, int *err, int len)
Definition: hecmw_couple_startup_if.c:43
HECMW_COUPLE_STARTUP_FINAL_IF
void HECMW_COUPLE_STARTUP_FINAL_IF(int *err)
Definition: hecmw_couple_startup_if.c:68
hecmw_struct.h
HECMW_NAME_LEN
#define HECMW_NAME_LEN
Definition: hecmw_config.h:70
hecmw_couple_startup_init_if_
void hecmw_couple_startup_init_if_(char *boundary_id, int *err, int len)
Definition: hecmw_couple_startup_if.c:33
hecmw_couple_startup.h
hecmw_lib_fc.h
hecmw_couple_startup_final_if
void hecmw_couple_startup_final_if(int *err)
Definition: hecmw_couple_startup_if.c:49
HECMW_strcpy_f2c_r
char * HECMW_strcpy_f2c_r(const char *fstr, int flen, char *buf, int bufsize)
Definition: hecmw_lib_fc.c:45
hecmw_couple_value
Definition: hecmw_couple_startup.h:9
hecmw_couple_startup_init_if__
void hecmw_couple_startup_init_if__(char *boundary_id, int *err, int len)
Definition: hecmw_couple_startup_if.c:38
hecmw_couple_startup_init_if
void hecmw_couple_startup_init_if(char *boundary_id, int *err, int len)
Definition: hecmw_couple_startup_if.c:20
HECMW_couple_free_couple_value
void HECMW_couple_free_couple_value(struct hecmw_couple_value *couple_value)
Definition: hecmw_couple_startup.c:27
HECMW_couple_startup
struct hecmw_couple_value * HECMW_couple_startup(const char *boundary_id)
Definition: hecmw_couple_startup.c:96
NULL
#define NULL
Definition: hecmw_io_nastran.c:30
HECMW_couple_copy_c2f_finalize
int HECMW_couple_copy_c2f_finalize(void)
Definition: hecmw_couple_copy_c2f.c:144
hecmw_couple_copy_c2f.h
hecmw_couple_startup_final_if__
void hecmw_couple_startup_final_if__(int *err)
Definition: hecmw_couple_startup_if.c:64