source: CPL/oasis3-mct/branches/OASIS3-MCT_5.0_branch/lib/cbindings/c_src/mod_oasis_part_c.c @ 6331

Last change on this file since 6331 was 6331, checked in by aclsce, 17 months ago

Moved oasis-mct_5.0 in oasis3-mct/branches directory.

File size: 1.7 KB
Line 
1/* pyOASIS - A Python wrapper for OASIS
2   Authors: Philippe Gambron, Rupert Ford
3   Copyright (C) 2019 UKRI - STFC
4 
5   This program is free software: you can redistribute it and/or modify
6   it under the terms of the GNU Lesser General Public License as
7   published by the Free Software Foundation, either version 3 of the
8   License, or any later version.
9 
10   This program is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13   GNU Lesser General Public License for more details.
14 
15   A copy of the GNU Lesser General Public License, version 3, is supplied
16   with this program, in the file lgpl-3.0.txt. It is also available at
17   <https://www.gnu.org/licenses/lgpl-3.0.html>. */
18
19
20#include "oasis_c.h"
21#include "oasis_c_iso.h"
22
23int oasis_c_def_partition(int* id_part, const int kparal_size, const int* kparal, const int ig_size, const char* name){
24  int kinfo;
25  int st = kparal[OASIS_Strategy];
26  if ((st != OASIS_Serial) && (st != OASIS_Apple) && (st != OASIS_Box) &&
27      (st!= OASIS_Orange) && (st != OASIS_Points) )
28    oasis_c_abort(0, "oasis_c_def_partition", "Wrong value for kparal[OASIS_Strategy]", __FILE__, __LINE__);
29  if ( kparal[OASIS_Strategy] == OASIS_Points ) {
30    int kparalf[kparal_size];
31    int i;
32    kparalf[OASIS_Strategy] = OASIS_Points;
33    kparalf[OASIS_Npoints] = kparal[OASIS_Npoints] ;
34    for (i = OASIS_Npoints+1; i<kparal_size; i++ ) kparalf[i] = kparal[i]+1;
35    oasis_def_partition_iso(id_part, &kparal_size, kparalf, &kinfo, &ig_size, &name);
36  } else {
37    oasis_def_partition_iso(id_part, &kparal_size, kparal, &kinfo, &ig_size, &name);
38  }
39  return kinfo;
40}
Note: See TracBrowser for help on using the repository browser.