FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
hecmw_couple_get_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 <string.h>
9 
10 #include "hecmw_struct.h"
11 #include "hecmw_io_get_mesh.h"
12 #include "hecmw_dist_free.h"
13 
14 #include "hecmw_couple_struct.h"
15 #include "hecmw_couple_info.h"
16 
17 extern struct hecmwST_local_mesh *HECMW_couple_get_mesh(char *name_ID,
18  char *unit_ID) {
19  struct hecmwST_local_mesh *mesh = NULL;
20  struct hecmw_couple_comm *intracomm = NULL;
21 
22  if ((mesh = HECMW_get_mesh(name_ID)) == NULL) return NULL;
23  if ((intracomm = HECMW_couple_get_intracomm_u(unit_ID)) == NULL) goto error;
24 
25  mesh->HECMW_COMM = intracomm->comm;
26  mesh->PETOT = intracomm->psize;
27  mesh->my_rank = intracomm->rank;
28 
29  HECMW_couple_free_comm(intracomm);
30 
31  return mesh;
32 
33 error:
35  return NULL;
36 }
struct hecmwST_local_mesh * HECMW_couple_get_mesh(char *name_ID, char *unit_ID)
struct hecmw_couple_comm * HECMW_couple_get_intracomm_u(const char *unit_id)
void HECMW_couple_free_comm(struct hecmw_couple_comm *comm)
void HECMW_dist_free(struct hecmwST_local_mesh *mesh)
struct hecmwST_local_mesh * mesh
Definition: hecmw_repart.h:71
struct hecmwST_local_mesh * HECMW_get_mesh(char *name_ID)
#define NULL
HECMW_Comm HECMW_COMM
Definition: hecmw_struct.h:209