FrontISTR 5.2.0
Large-scale structural analysis program with finit element method
Loading...
Searching...
No Matches
hecmw_couple_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
16
17static struct hecmw_couple_value *couple_value;
18
19/*================================================================================================*/
20
21extern void hecmw_couple_exec_init_if(int *err) {
22 *err = 1;
23
24 if ((couple_value = HECMW_couple_alloc_couple_value()) == NULL) return;
25 if (HECMW_couple_copy_f2c_init(couple_value)) return;
26
27 *err = 0;
28}
29
30extern void hecmw_couple_exec_init_if_(int *err) {
32}
33
34extern void hecmw_couple_exec_init_if__(int *err) {
36}
37
38extern void HECMW_COUPLE_EXEC_INIT_IF(int *err) {
40}
41
42/*------------------------------------------------------------------------------------------------*/
43
44extern void hecmw_couple_if(char *boundary_id, int *err, int len) {
45 char cname[HECMW_NAME_LEN + 1];
46
47 *err = 1;
48
49 if (HECMW_strcpy_f2c_r(boundary_id, len, cname, sizeof(cname)) == NULL)
50 return;
51 if (HECMW_couple(cname, couple_value) != HECMW_SUCCESS) return;
52 if (HECMW_couple_copy_c2f_init(couple_value)) return;
53
54 *err = 0;
55}
56
57extern void hecmw_couple_if_(char *boundary_id, int *err, int len) {
58 hecmw_couple_if(boundary_id, err, len);
59}
60
61extern void hecmw_couple_if__(char *boundary_id, int *err, int len) {
62 hecmw_couple_if(boundary_id, err, len);
63}
64
65extern void HECMW_COUPLE_IF(char *boundary_id, int *err, int len) {
66 hecmw_couple_if(boundary_id, err, len);
67}
68
69/*------------------------------------------------------------------------------------------------*/
70
71extern void hecmw_couple_exec_finalize_if(int *err) {
72 *err = 1;
73
76 couple_value = NULL;
77
78 *err = 0;
79}
80
81extern void hecmw_couple_exec_finalize_if_(int *err) {
83}
84
85extern void hecmw_couple_exec_finalize_if__(int *err) {
87}
88
89extern void HECMW_COUPLE_EXEC_FINALIZE_IF(int *err) {
91}
#define HECMW_SUCCESS
Definition: hecmw_config.h:64
#define HECMW_NAME_LEN
Definition: hecmw_config.h:70
int HECMW_couple(const char *boundary_id, struct hecmw_couple_value *couple_value)
Definition: hecmw_couple.c:748
int HECMW_couple_copy_c2f_init(struct hecmw_couple_value *_couple_value)
int HECMW_couple_copy_f2c_init(struct hecmw_couple_value *_couple_value)
int HECMW_couple_copy_f2c_finalize(void)
void hecmw_couple_exec_finalize_if(int *err)
void HECMW_COUPLE_IF(char *boundary_id, int *err, int len)
void hecmw_couple_if__(char *boundary_id, int *err, int len)
void hecmw_couple_if(char *boundary_id, int *err, int len)
void hecmw_couple_exec_init_if__(int *err)
void hecmw_couple_exec_init_if(int *err)
void hecmw_couple_if_(char *boundary_id, int *err, int len)
void hecmw_couple_exec_init_if_(int *err)
void HECMW_COUPLE_EXEC_FINALIZE_IF(int *err)
void HECMW_COUPLE_EXEC_INIT_IF(int *err)
void hecmw_couple_exec_finalize_if__(int *err)
void hecmw_couple_exec_finalize_if_(int *err)
struct hecmw_couple_value * HECMW_couple_alloc_couple_value(void)
void HECMW_couple_free_couple_value(struct hecmw_couple_value *couple_value)
#define NULL
char * HECMW_strcpy_f2c_r(const char *fstr, int flen, char *buf, int bufsize)
Definition: hecmw_lib_fc.c:45