| 1 |
/* |
| 2 |
* Copyright(C) 1999-2020 National Technology & Engineering Solutions |
| 3 |
* of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 4 |
* NTESS, the U.S. Government retains certain rights in this software. |
| 5 |
* |
| 6 |
* See packages/seacas/LICENSE for details |
| 7 |
*/ |
| 8 |
/***************************************************************************** |
| 9 |
* |
| 10 |
* expblk - ex_put_block: write edge, face, or element block parameters |
| 11 |
* |
| 12 |
* entry conditions - |
| 13 |
* input parameters: |
| 14 |
* int idexo exodus file id |
| 15 |
* int blk_type type of block (edge, face, or element) |
| 16 |
* int blk_id block identifier |
| 17 |
* char* entry_descrip string describing shape of entries in |
| 18 |
*the block |
| 19 |
* int num_entries_this_blk number of entries(records) in the block |
| 20 |
* int num_nodes_per_entry number of nodes per block entry |
| 21 |
* int num_edges_per_entry number of edges per block entry |
| 22 |
* int num_faces_per_entry number of faces per block entry |
| 23 |
* int num_attr_per_entry number of attributes per block entry |
| 24 |
* |
| 25 |
* exit conditions - |
| 26 |
* |
| 27 |
* |
| 28 |
*****************************************************************************/ |
| 29 |
|
| 30 |
#include "exodusII.h" // for ex_block, MAX_STR_LENGTH, etc |
| 31 |
#include "exodusII_int.h" |
| 32 |
|
| 33 |
/*! |
| 34 |
* writes the parameters used to describe an element/face/edge block |
| 35 |
* \param exoid exodus file id |
| 36 |
* \param blk_type type of block (edge, face, or element) |
| 37 |
* \param blk_id block identifier |
| 38 |
* \param entry_descrip string describing shape of entries in the |
| 39 |
* block |
| 40 |
* \param num_entries_this_blk number of entries(records) in the block |
| 41 |
* \param num_nodes_per_entry number of nodes per block entry |
| 42 |
* \param num_edges_per_entry number of edges per block entry |
| 43 |
* \param num_faces_per_entry number of faces per block entry |
| 44 |
* \param num_attr_per_entry number of attributes per block entry |
| 45 |
*/ |
| 46 |
|
| 47 |
int ex_put_block(int exoid, ex_entity_type blk_type, ex_entity_id blk_id, const char *entry_descrip, |
| 48 |
int64_t num_entries_this_blk, int64_t num_nodes_per_entry, |
| 49 |
int64_t num_edges_per_entry, int64_t num_faces_per_entry, |
| 50 |
int64_t num_attr_per_entry) |
| 51 |
{ |
| 52 |
ex_block block = {.type = blk_type, |
| 53 |
.id = blk_id, |
| 54 |
.num_entry = num_entries_this_blk, |
| 55 |
.num_nodes_per_entry = num_nodes_per_entry, |
| 56 |
.num_edges_per_entry = num_edges_per_entry, |
| 57 |
.num_faces_per_entry = num_faces_per_entry, |
| 58 |
.num_attribute = num_attr_per_entry}; |
| 59 |
|
| 60 |
ex_copy_string(block.topology, entry_descrip, MAX_STR_LENGTH + 1); |
| 61 |
block.topology[MAX_STR_LENGTH] = '\0'; |
| 62 |
|
| 63 |
return ex_put_block_param(exoid, block); |
| 64 |
} |