Debian Codegraph @

packages/seacas/applications/nem_spread/rf_pre_proc.C

raw
1 /*
2 * Copyright(C) 1999-2021 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 #include "rf_allo.h" // for array_alloc
10 #include <cstddef> // for size_t
11 #include <nem_spread.h> // for NemSpread
12
13 template void NemSpread<double, int>::create_elem_types();
14 template void NemSpread<float, int>::create_elem_types();
15 template void NemSpread<double, int64_t>::create_elem_types();
16 template void NemSpread<float, int64_t>::create_elem_types();
17
18 template <typename T, typename INT> void NemSpread<T, INT>::create_elem_types()
19 /*
20 * Function which creates a vector of element types for each element.
21 */
22 {
23 globals.Elem_Type = (int **)array_alloc(__FILE__, __LINE__, 1, Proc_Info[2], sizeof(int *));
24
25 for (int iproc = 0; iproc < Proc_Info[2]; iproc++) {
26
27 globals.Elem_Type[iproc] = (int *)array_alloc(
28 __FILE__, __LINE__, 1, globals.Num_Internal_Elems[iproc] + globals.Num_Border_Elems[iproc],
29 sizeof(int));
30
31 /*
32 * Loop through all the element blocks on the processor,
33 * setting the element type for each element in each block
34 */
35 size_t ielem_count = 0;
36 for (int i = 0; i < globals.Proc_Num_Elem_Blk[iproc]; i++) {
37 int ielem_type = globals.Proc_Elem_Blk_Types[iproc][i];
38 for (int j = 0; j < globals.Proc_Num_Elem_In_Blk[iproc][i]; j++) {
39 globals.Elem_Type[iproc][ielem_count++] = ielem_type;
40 }
41 }
42 }
43 }