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

« back to all changes in this revision

Viewing changes to src/base/cs_ast_coupling.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
1
/*============================================================================
2
 
 *
3
 
 *     This file is part of the Code_Saturne Kernel, element of the
4
 
 *     Code_Saturne CFD tool.
5
 
 *
6
 
 *     Copyright (C) 1998-2009 EDF S.A., France
7
 
 *
8
 
 *     contact: saturne-support@edf.fr
9
 
 *
10
 
 *     The Code_Saturne Kernel is free software; you can redistribute it
11
 
 *     and/or modify it under the terms of the GNU General Public License
12
 
 *     as published by the Free Software Foundation; either version 2 of
13
 
 *     the License, or (at your option) any later version.
14
 
 *
15
 
 *     The Code_Saturne Kernel is distributed in the hope that it will be
16
 
 *     useful, but WITHOUT ANY WARRANTY; without even the implied warranty
17
 
 *     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 
 *     GNU General Public License for more details.
19
 
 *
20
 
 *     You should have received a copy of the GNU General Public License
21
 
 *     along with the Code_Saturne Kernel; if not, write to the
22
 
 *     Free Software Foundation, Inc.,
23
 
 *     51 Franklin St, Fifth Floor,
24
 
 *     Boston, MA  02110-1301  USA
25
 
 *
26
 
 *============================================================================*/
27
 
 
28
 
/*============================================================================
29
2
 * Code_Aster coupling
30
3
 *============================================================================*/
31
4
 
 
5
/*
 
6
  This file is part of Code_Saturne, a general-purpose CFD tool.
 
7
 
 
8
  Copyright (C) 1998-2011 EDF S.A.
 
9
 
 
10
  This program is free software; you can redistribute it and/or modify it under
 
11
  the terms of the GNU General Public License as published by the Free Software
 
12
  Foundation; either version 2 of the License, or (at your option) any later
 
13
  version.
 
14
 
 
15
  This program is distributed in the hope that it will be useful, but WITHOUT
 
16
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
17
  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
18
  details.
 
19
 
 
20
  You should have received a copy of the GNU General Public License along with
 
21
  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
 
22
  Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
23
*/
 
24
 
 
25
/*----------------------------------------------------------------------------*/
 
26
 
32
27
#if defined(HAVE_CONFIG_H)
33
28
#include "cs_config.h"
34
29
#endif
177
172
 
178
173
  ifs_mesh = cs_mesh_connect_faces_to_nodal(cs_glob_mesh,
179
174
                                            "MaillageExtraitAster_1",
 
175
                                            false,
180
176
                                            0,
181
177
                                            n_faces,
182
178
                                            NULL,
242
238
    geom[1] = n_nodes;
243
239
 
244
240
    cs_calcium_write_int(comp_id, time_dep, cur_time, 0,
245
 
                         "dongeo", 2, &(geom[0]));
 
241
                         "DONGEO", 2, &(geom[0]));
246
242
 
247
243
    BFT_FREE(geom);
248
244
 
249
245
    cs_calcium_write_double(comp_id, time_dep, cur_time, 0,
250
 
                            "almaxi", 1, almax);
251
 
 
252
 
    cs_calcium_write_double(comp_id, time_dep, cur_time, 0,
253
 
                            "coofac", 3*n_faces,&(faces_coords[0]));
254
 
 
255
 
    cs_calcium_write_double(comp_id, time_dep, cur_time, 0,
256
 
                            "coonod", 3*n_nodes,&(nodes_coords[0]));
257
 
 
258
 
    cs_calcium_write_int(comp_id, time_dep, cur_time, 0,
259
 
                         "colfac", n_faces, &(faces_color[0]));
260
 
 
261
 
    cs_calcium_write_int(comp_id, time_dep, cur_time, 0,
262
 
                         "colnod", n_nodes, &(nodes_color[0]));
 
246
                            "ALMAXI", 1, almax);
 
247
 
 
248
    cs_calcium_write_double(comp_id, time_dep, cur_time, 0,
 
249
                            "COOFAC", 3*n_faces,&(faces_coords[0]));
 
250
 
 
251
    cs_calcium_write_double(comp_id, time_dep, cur_time, 0,
 
252
                            "COONOD", 3*n_nodes,&(nodes_coords[0]));
 
253
 
 
254
    cs_calcium_write_int(comp_id, time_dep, cur_time, 0,
 
255
                         "COLFAC", n_faces, &(faces_color[0]));
 
256
 
 
257
    cs_calcium_write_int(comp_id, time_dep, cur_time, 0,
 
258
                         "COLNOD", n_nodes, &(nodes_color[0]));
263
259
 
264
260
  }
265
261
 
321
317
  if (cs_glob_rank_id <= 0) {
322
318
 
323
319
    cs_calcium_write_double(comp_id, time_dep, cur_time, *ntcast,
324
 
                            "forsat", 3*n_g_faces, _forast);
 
320
                            "FORSAT", 3*n_g_faces, _forast);
325
321
 
326
322
    BFT_FREE(_forast);
327
323
 
370
366
 
371
367
    cs_calcium_read_double(comp_id, time_dep, &min_time, &max_time,
372
368
                           ntcast,
373
 
                           "depsat", 3*n_g_nodes,
 
369
                           "DEPSAT", 3*n_g_nodes,
374
370
                           &n_val_read, _xast);
375
371
 
376
372
    assert(n_val_read == 3*n_g_nodes);
406
402
 
407
403
  mesh_ifs = cs_mesh_connect_faces_to_nodal(cs_glob_mesh,
408
404
                                            "MaillageExtraitAster_1",
 
405
                                            false,
409
406
                                            0,
410
407
                                            n_faces,
411
408
                                            NULL,
445
442
 cs_int_t  *nbpdt,
446
443
 cs_int_t  *nbsspdt,
447
444
 cs_real_t *delta,
448
 
 cs_int_t  *ihi,
449
 
 cs_int_t  *chro,
450
445
 cs_real_t *tt,
451
446
 cs_real_t *dt
452
447
)
478
473
    /* commande reception nb iterations */
479
474
    cs_calcium_read_int(comp_id, time_dep, &min_time, &max_time,
480
475
                        &iteration,
481
 
                        "nbpdtm", 1, &n_val_read, nbpdt);
 
476
                        "NBPDTM", 1, &n_val_read, nbpdt);
482
477
    /* commande reception nb sous-it.  */
483
478
    cs_calcium_read_int(comp_id, time_dep, &min_time, &max_time,
484
479
                        &iteration,
485
 
                        "nbssit",1,&n_val_read, nbsspdt);
 
480
                        "NBSSIT",1,&n_val_read, nbsspdt);
486
481
    /* commande reception de la variable epsilo */
487
482
    cs_calcium_read_double(comp_id, time_dep, &min_time, &max_time,
488
483
                           &iteration,
489
 
                           "epsilo",1,&n_val_read, delta);
490
 
    /* commande reception de la variable isyncp */
491
 
    cs_calcium_read_int(comp_id, time_dep, &min_time, &max_time,
492
 
                        &iteration,
493
 
                        "isyncp",1,&n_val_read, ihi);
494
 
    /* commande reception de la variable ntchr  */
495
 
    cs_calcium_read_int(comp_id, time_dep, &min_time, &max_time,
496
 
                        &iteration,
497
 
                        "ntchro",1,&n_val_read, chro);
 
484
                           "EPSILO",1,&n_val_read, delta);
498
485
    /* commande reception de la variable ttinit */
499
486
    cs_calcium_read_double(comp_id, time_dep, &min_time, &max_time,
500
487
                           &iteration,
501
 
                           "ttinit",1,&n_val_read, &ttanc);
 
488
                           "TTINIT",1,&n_val_read, &ttanc);
502
489
    /* commande reception de la variable dtref */
503
490
    cs_calcium_read_double(comp_id, time_dep, &min_time, &max_time,
504
491
                           &iteration,
505
 
                           "pdtref",1,&n_val_read, dt);
 
492
                           "PDTREF",1,&n_val_read, dt);
506
493
 
507
494
    if (fabs(*tt - ttanc) > 1.e-16)
508
495
      bft_error(__FILE__, __LINE__, 0,
516
503
 
517
504
    MPI_Bcast(nbpdt,   1, CS_MPI_INT,  0, cs_glob_mpi_comm);
518
505
    MPI_Bcast(nbsspdt, 1, CS_MPI_INT,  0, cs_glob_mpi_comm);
519
 
    MPI_Bcast(ihi,     1, CS_MPI_INT,  0, cs_glob_mpi_comm);
520
 
    MPI_Bcast(chro,    1, CS_MPI_INT,  0, cs_glob_mpi_comm);
521
506
    MPI_Bcast(delta,   1, CS_MPI_REAL, 0, cs_glob_mpi_comm);
522
507
    MPI_Bcast(dt,      1, CS_MPI_REAL, 0, cs_glob_mpi_comm);
523
508
 
541
526
               "@      NTMABS = %i                                         \n"
542
527
               "@      NALIMX = %i                                         \n"
543
528
               "@      EPALIM = %f                                         \n"
544
 
               "@      ISYNCP = %i                                         \n"
545
 
               "@      NTCHR  = %i                                         \n"
546
529
               "@      DTREF  = %f                                         \n"
547
530
               "@                                                          \n"
548
531
               "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
549
532
               "@                                                          \n",
550
 
             *nbpdt, *nbsspdt, *delta, *ihi, *chro, *dt);
 
533
             *nbpdt, *nbsspdt, *delta, *dt);
551
534
}
552
535
 
553
536
/*----------------------------------------------------------------------------
573
556
 
574
557
    /* Send time step (calculated in "ddtvar" Subroutine) to'Milieu'*/
575
558
    cs_calcium_write_double(comp_id, time_dep, 0.0, *nbpdt,
576
 
                            "dtsat", 1, &dttmp);
 
559
                            "DTSAT", 1, &dttmp);
577
560
 
578
561
    /* Receive time step sent by 'Milieu' */
579
562
    cs_calcium_read_double(comp_id, time_dep, &min_time, &max_time,
580
563
                           nbpdt,
581
 
                           "dtcalc", 1, &n_val_read, &(dtloc));
 
564
                           "DTCALC", 1, &n_val_read, &(dtloc));
582
565
 
583
566
    assert(n_val_read == 1);
584
567
 
639
622
    int  n_val_read = 0;
640
623
 
641
624
    cs_calcium_read_int(comp_id, time_dep, &min_time, &max_time, ntcast,
642
 
                        "icvext", 1, &n_val_read, icv);
 
625
                        "ICVEXT", 1, &n_val_read, icv);
643
626
 
644
627
    assert(n_val_read == 1);
645
628
 
667
650
  if (cs_glob_rank_id <= 0) {
668
651
 
669
652
    cs_calcium_write_int(comp_id, time_dep, cur_time, *ntcast,
670
 
                         "icv", 1, icv);
 
653
                         "ICV", 1, icv);
671
654
 
672
655
  }
673
656
}