Lines Matching refs:dim
59 static PetscErrorCode zero(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc, PetscSca… in zero() argument
62 for (d = 0; d < dim; ++d) u[d] = 0.0; in zero()
66 static PetscErrorCode ge_shift(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc, Pets… in ge_shift() argument
70 for (d = 1; d < dim; ++d) u[d] = 0.0; in ge_shift()
74 static PetscErrorCode quadratic_2d_u(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc… in quadratic_2d_u() argument
81 static PetscErrorCode quadratic_3d_u(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc… in quadratic_3d_u() argument
99 static void f0_vlap_quadratic_u(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], c… in f0_vlap_quadratic_u() argument
102 for (d = 0; d < dim; ++d) f0[d] += 2.0; in f0_vlap_quadratic_u()
126 static void f0_elas_quadratic_u(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], c… in f0_elas_quadratic_u() argument
131 for (PetscInt d = 0; d < dim - 1; ++d) f0[d] += 2.0 * mu; in f0_elas_quadratic_u()
132 f0[dim - 1] += 2.0 * lambda + 4.0 * mu; in f0_elas_quadratic_u()
135 static void f0_mass_quadratic_u(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], c… in f0_mass_quadratic_u() argument
137 if (dim == 2) { in f0_mass_quadratic_u()
147 static PetscErrorCode trig_2d_u(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc, Pet… in trig_2d_u() argument
154 static PetscErrorCode trig_3d_u(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc, Pet… in trig_3d_u() argument
172 static void f0_vlap_trig_u(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const … in f0_vlap_trig_u() argument
175 …for (d = 0; d < dim; ++d) f0[d] += -4.0 * PetscSqr(PETSC_PI) * PetscSinReal(2.0 * PETSC_PI * x[d]); in f0_vlap_trig_u()
199 static void f0_elas_trig_u(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const … in f0_elas_trig_u() argument
205 …for (PetscInt d = 0; d < dim; ++d) f0[d] += -(2.0 * mu + lambda) * fact * PetscSinReal(2.0 * PETSC… in f0_elas_trig_u()
208 static PetscErrorCode axial_disp_u(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc, … in axial_disp_u() argument
221 for (PetscInt d = 2; d < dim; ++d) u[d] = 0.0; in axial_disp_u()
255 static void f0_elas_axial_disp_bd_u(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[… in f0_elas_axial_disp_bd_u() argument
262 static PetscErrorCode uniform_strain_u(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt … in uniform_strain_u() argument
271 for (d = 2; d < dim; ++d) u[d] = 0.0; in uniform_strain_u()
275 static void f0_mass_u(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const Petsc… in f0_mass_u() argument
277 const PetscInt Nc = dim; in f0_mass_u()
283 static void f1_vlap_u(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const Petsc… in f1_vlap_u() argument
285 const PetscInt Nc = dim; in f1_vlap_u()
289 for (d = 0; d < dim; ++d) f1[c * dim + d] += u_x[c * dim + d]; in f1_vlap_u()
292 static void f1_elas_u(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const Petsc… in f1_elas_u() argument
296 const PetscInt Nc = dim; in f1_elas_u()
299 for (PetscInt d = 0; d < dim; ++d) { in f1_elas_u()
300 f1[c * dim + d] += mu * (u_x[c * dim + d] + u_x[d * dim + c]); in f1_elas_u()
301 f1[c * dim + c] += lambda * u_x[d * dim + d]; in f1_elas_u()
306 static void g0_mass_uu(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const Pets… in g0_mass_uu() argument
308 const PetscInt Nc = dim; in g0_mass_uu()
314 static void g3_vlap_uu(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const Pets… in g3_vlap_uu() argument
316 const PetscInt Nc = dim; in g3_vlap_uu()
320 for (d = 0; d < dim; ++d) g3[((c * Nc + c) * dim + d) * dim + d] = 1.0; in g3_vlap_uu()
330 static void g3_elas_uu(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const Pets… in g3_elas_uu() argument
334 const PetscInt Nc = dim; in g3_elas_uu()
337 for (PetscInt d = 0; d < dim; ++d) { in g3_elas_uu()
338 g3[((c * Nc + c) * dim + d) * dim + d] += mu; in g3_elas_uu()
339 g3[((c * Nc + d) * dim + d) * dim + c] += mu; in g3_elas_uu()
340 g3[((c * Nc + d) * dim + c) * dim + d] += lambda; in g3_elas_uu()
459 PetscInt dim; in SetupPrimalProblem() local
464 PetscCall(PetscDSGetSpatialDimension(ds, &dim)); in SetupPrimalProblem()
471 switch (dim) { in SetupPrimalProblem()
479 …Q(PetscObjectComm((PetscObject)ds), PETSC_ERR_ARG_WRONG, "Invalid dimension: %" PetscInt_FMT, dim); in SetupPrimalProblem()
485 switch (dim) { in SetupPrimalProblem()
493 …Q(PetscObjectComm((PetscObject)ds), PETSC_ERR_ARG_WRONG, "Invalid dimension: %" PetscInt_FMT, dim); in SetupPrimalProblem()
499 switch (dim) { in SetupPrimalProblem()
507 …Q(PetscObjectComm((PetscObject)ds), PETSC_ERR_ARG_WRONG, "Invalid dimension: %" PetscInt_FMT, dim); in SetupPrimalProblem()
513 switch (dim) { in SetupPrimalProblem()
521 …Q(PetscObjectComm((PetscObject)ds), PETSC_ERR_ARG_WRONG, "Invalid dimension: %" PetscInt_FMT, dim); in SetupPrimalProblem()
527 switch (dim) { in SetupPrimalProblem()
535 …Q(PetscObjectComm((PetscObject)ds), PETSC_ERR_ARG_WRONG, "Invalid dimension: %" PetscInt_FMT, dim); in SetupPrimalProblem()
541 id = dim == 3 ? 5 : 2; in SetupPrimalProblem()
566 id = dim == 3 ? 6 : 4; in SetupPrimalProblem()
569 cmp = dim == 3 ? 2 : 1; in SetupPrimalProblem()
570 id = dim == 3 ? 1 : 1; in SetupPrimalProblem()
572 if (dim == 3) { in SetupPrimalProblem()
580 id = dim == 3 ? 6 : 4; in SetupPrimalProblem()
582 id = dim == 3 ? 5 : 2; in SetupPrimalProblem()
615 PetscInt dim, cStart; in SetupFE() local
619 PetscCall(DMGetDimension(dm, &dim)); in SetupFE()
623 PetscCall(PetscFECreateByCell(PETSC_COMM_SELF, dim, dim, ct, name ? prefix : NULL, -1, &fe)); in SetupFE()