Lines Matching +full:- +full:std

10    Contributed-by: Fande Kong <fdkong.jd@gmail.com>, John Peterson <jwpeterson@gmail.com>
40 PetscCall(PetscOptionsGetString(NULL, NULL, "-f0", file[0], sizeof(file[0]), &flg));
41 PetscCheck(flg, PETSC_COMM_WORLD, PETSC_ERR_USER, "Must indicate dof indices file for rank 0 with -f0 option");
43 PetscCall(PetscOptionsGetString(NULL, NULL, "-f1", file[1], sizeof(file[1]), &flg));
44 PetscCheck(flg, PETSC_COMM_WORLD, PETSC_ERR_USER, "Must indicate dof indices file for rank 1 with -f1 option");
61 std::vector<std::vector<std::vector<PetscInt>>> elem_dof_indices(size);
63 std::string line;
64 std::ifstream dof_file(file[proc_id]);
66 while (std::getline(dof_file, line)) {
67 std::vector<PetscInt> dof_indices;
68 std::stringstream sstream(line);
69 std::string token;
70 while (std::getline(sstream, token, ' ')) dof_indices.push_back(std::atoi(token.c_str()));
81 // std::cout << elem_dof_indices[i][j][k] << " ";
82 // std::cout << std::endl;
84 // std::cout << std::endl;
88 std::vector<std::set<unsigned int>> sparsity(n_dofs);
91 std::vector<PetscInt> &dof_indices = elem_dof_indices[proc_id][k];
97 const unsigned int n_local_dofs = last_local_index - first_local_index;
98 std::vector<PetscInt> n_nz(n_local_dofs);
99 std::vector<PetscInt> n_oz(n_local_dofs);
102 for (std::set<unsigned int>::iterator iter = sparsity[i + first_local_index].begin(); iter != sparsity[i + first_local_index].end(); iter++) {
109 // Debugging: print number of on/off-diagonal nonzeros
111 // std::cout << n_nz[i] << " ";
112 // std::cout << std::endl;
115 // std::cout << n_oz[i] << " ";
116 // std::cout << std::endl;
118 // Compute and print max number of on- and off-diagonal nonzeros.
119 PetscInt n_nz_max = *std::max_element(n_nz.begin(), n_nz.end());
120 PetscInt n_oz_max = *std::max_element(n_oz.begin(), n_oz.end());
122 PetscCall(PetscSynchronizedPrintf(PETSC_COMM_WORLD, "Max on-diagonal non-zeros: = %" PetscInt_FMT "\n", n_nz_max));
123 PetscCall(PetscSynchronizedPrintf(PETSC_COMM_WORLD, "Max off-diagonal non-zeros: = %" PetscInt_FMT "\n", n_oz_max));
139 std::vector<PetscInt> &dof_indices = elem_dof_indices[rank][k];
142 std::vector<PetscScalar> ones(dof_indices.size() * dof_indices.size(), 1.);
161 args: -f0 ${DATAFILESPATH}/meshes/moose_dof_indices_np_2_proc_0.txt -f1 ${DATAFILESPATH}/meshes/moose_dof_indices_np_2_proc_1.txt