~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to preprocessor/pre-post/ecs_table_comm.c

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-24 00:00:08 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20111124000008-2vo99e38267942q5
Tags: 2.1.0-3
Install a missing file

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*============================================================================
 
2
 *  Definitions des fonctions
 
3
 *   associees a la structure `ecs_table_t' decrivant une table
 
4
 *   et realisant les sorties pour la communication
 
5
 *============================================================================*/
 
6
 
 
7
/*
 
8
  This file is part of Code_Saturne, a general-purpose CFD tool.
 
9
 
 
10
  Copyright (C) 1998-2011 EDF S.A.
 
11
 
 
12
  This program is free software; you can redistribute it and/or modify it under
 
13
  the terms of the GNU General Public License as published by the Free Software
 
14
  Foundation; either version 2 of the License, or (at your option) any later
 
15
  version.
 
16
 
 
17
  This program is distributed in the hope that it will be useful, but WITHOUT
 
18
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
19
  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
20
  details.
 
21
 
 
22
  You should have received a copy of the GNU General Public License along with
 
23
  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
 
24
  Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
25
*/
 
26
 
 
27
/*----------------------------------------------------------------------------*/
 
28
 
 
29
/*============================================================================
 
30
 *                                 Visibilite
 
31
 *============================================================================*/
 
32
 
 
33
/*----------------------------------------------------------------------------
 
34
 *  Fichiers `include' librairie standard C
 
35
 *----------------------------------------------------------------------------*/
 
36
 
 
37
#include <assert.h>
 
38
#include <string.h> /* strlen() */
 
39
 
 
40
 
 
41
/*----------------------------------------------------------------------------
 
42
 *  Fichiers `include' visibles du  paquetage global "Utilitaire"
 
43
 *----------------------------------------------------------------------------*/
 
44
 
 
45
#include "ecs_def.h"
 
46
#include "ecs_mem.h"
 
47
 
 
48
 
 
49
/*----------------------------------------------------------------------------
 
50
 *  Fichiers `include' visibles du  paquetage global "Post-Traitement"
 
51
 *----------------------------------------------------------------------------*/
 
52
 
 
53
#include "ecs_comm.h"
 
54
 
 
55
 
 
56
/*----------------------------------------------------------------------------
 
57
  *  Fichiers `include' visibles des paquetages visibles
 
58
 *----------------------------------------------------------------------------*/
 
59
 
 
60
 
 
61
/*----------------------------------------------------------------------------
 
62
 *  Fichiers `include' visibles du  paquetage courant
 
63
 *----------------------------------------------------------------------------*/
 
64
 
 
65
#include "ecs_table.h"
 
66
 
 
67
 
 
68
/*----------------------------------------------------------------------------
 
69
 *  Fichier  `include' du  paquetage courant associe au fichier courant
 
70
 *----------------------------------------------------------------------------*/
 
71
 
 
72
#include "ecs_table_comm.h"
 
73
 
 
74
 
 
75
/*----------------------------------------------------------------------------
 
76
 *  Fichiers `include' prives   du  paquetage courant
 
77
 *----------------------------------------------------------------------------*/
 
78
 
 
79
#include "ecs_table_priv.h"
 
80
 
 
81
 
 
82
/*============================================================================
 
83
 *                              Fonctions privees
 
84
 *============================================================================*/
 
85
 
 
86
/*============================================================================
 
87
 *                             Fonctions publiques
 
88
 *============================================================================*/
 
89
 
 
90
/*----------------------------------------------------------------------------
 
91
 *  Fonction qui ecrit le tableau des positions d'une table
 
92
 *   dans le fichier d'interface pour le Noyau
 
93
 *----------------------------------------------------------------------------*/
 
94
 
 
95
void
 
96
ecs_table_comm__ecr_pos(ecs_table_t  *this_table,
 
97
                        const char   *comm_nom_rubrique,
 
98
                        size_t        location_id,
 
99
                        size_t        index_id,
 
100
                        ecs_comm_t   *comm)
 
101
{
 
102
  /*xxxxxxxxxxxxxxxxxxxxxxxxxxx Instructions xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
 
103
 
 
104
  assert(this_table != NULL);
 
105
 
 
106
  ecs_table__regle_en_pos(this_table);
 
107
 
 
108
  ecs_comm_write_section(comm_nom_rubrique,
 
109
                         this_table->nbr + 1,
 
110
                         location_id,
 
111
                         index_id,
 
112
                         1,
 
113
                         false,
 
114
                         this_table->pos,
 
115
                         ECS_TYPE_ecs_size_t,
 
116
                         comm);
 
117
 
 
118
  ecs_table__pos_en_regle(this_table);
 
119
}
 
120
 
 
121
/*----------------------------------------------------------------------------
 
122
 *  Fonction qui ecrit le contenu d'une table
 
123
 *   dans le fichier d'interface pour le Noyau
 
124
 *----------------------------------------------------------------------------*/
 
125
 
 
126
void
 
127
ecs_table_comm__ecr(ecs_table_t  *this_table,
 
128
                    const char   *comm_nom_rubrique,
 
129
                    size_t        location_id,
 
130
                    size_t        index_id,
 
131
                    size_t        n_location_values,
 
132
                    ecs_comm_t   *comm)
 
133
{
 
134
  size_t      nbr_val;
 
135
 
 
136
  /*xxxxxxxxxxxxxxxxxxxxxxxxxxx Instructions xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
 
137
 
 
138
  assert(this_table != NULL);
 
139
 
 
140
  nbr_val = ecs_table__ret_val_nbr(this_table);
 
141
 
 
142
  assert(nbr_val > 0);
 
143
 
 
144
  ecs_comm_write_section(comm_nom_rubrique,
 
145
                         nbr_val,
 
146
                         location_id,
 
147
                         index_id,
 
148
                         n_location_values,
 
149
                         false,
 
150
                         this_table->val,
 
151
                         ECS_TYPE_ecs_int_t,
 
152
                         comm);
 
153
}
 
154
 
 
155
/*----------------------------------------------------------------------------*/
 
156