Lines Matching refs:dim

24 static PetscErrorCode zero_func(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc, Pet…  in zero_func()  argument
34 static PetscErrorCode linear_u(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc, Pets… in linear_u() argument
40 static PetscErrorCode linear_p(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc, Pets… in linear_p() argument
42 u[0] = dim; in linear_p()
51 static PetscErrorCode sinusoid_u(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc, Pe… in sinusoid_u() argument
57 static PetscErrorCode sinusoid_p(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc, Pe… in sinusoid_p() argument
61 for (d = 0; d < dim; ++d) u[0] += 2 * PETSC_PI * PetscCosReal(2 * PETSC_PI * x[d]); in sinusoid_p()
66 static void f0_v_linear(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const Pet… in f0_v_linear() argument
71 PetscCallAbort(PETSC_COMM_SELF, PetscCalloc1(dim, &u_rhs)); in f0_v_linear()
72 PetscCallAbort(PETSC_COMM_SELF, linear_u(dim, t, x, dim, u_rhs, NULL)); in f0_v_linear()
73 for (i = 0; i < dim; ++i) f0[i] = u[uOff[0] + i] - u_rhs[i]; in f0_v_linear()
77 static void f0_v_sinusoid(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const P… in f0_v_sinusoid() argument
82 PetscCallAbort(PETSC_COMM_SELF, PetscCalloc1(dim, &u_rhs)); in f0_v_sinusoid()
83 PetscCallAbort(PETSC_COMM_SELF, sinusoid_u(dim, t, x, dim, u_rhs, NULL)); in f0_v_sinusoid()
84 for (i = 0; i < dim; ++i) f0[i] = u[uOff[0] + i] - u_rhs[i]; in f0_v_sinusoid()
89 static void f0_q(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const PetscInt u… in f0_q() argument
95 for (i = 0; i < dim; ++i) divu += u_x[uOff_x[0] + i * dim + i]; in f0_q()
100 static void f0_w(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const PetscInt u… in f0_w() argument
106 for (i = 0; i < dim; ++i) divu += u_x[uOff_x[0] + i * dim + i]; in f0_w()
112 static void f0_bd_u_sinusoid(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], cons… in f0_bd_u_sinusoid() argument
117 PetscCallAbort(PETSC_COMM_SELF, PetscCalloc1(dim, &u_rhs)); in f0_bd_u_sinusoid()
118 PetscCallAbort(PETSC_COMM_SELF, sinusoid_u(dim, t, x, dim, u_rhs, NULL)); in f0_bd_u_sinusoid()
119 for (d = 0; d < dim; ++d) f0[d] = u_rhs[d]; in f0_bd_u_sinusoid()
123 static void f0_bd_u_linear(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const … in f0_bd_u_linear() argument
128 PetscCallAbort(PETSC_COMM_SELF, PetscCalloc1(dim, &u_rhs)); in f0_bd_u_linear()
129 PetscCallAbort(PETSC_COMM_SELF, linear_u(dim, t, x, dim, u_rhs, NULL)); in f0_bd_u_linear()
130 for (d = 0; d < dim; ++d) f0[d] = u_rhs[d]; in f0_bd_u_linear()
137 static void g0_vu(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const PetscInt … in g0_vu() argument
140 for (c = 0; c < dim; ++c) g0[c * dim + c] = 1.0; in g0_vu()
144 static void g0_qp(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const PetscInt … in g0_qp() argument
147 for (d = 0; d < dim; ++d) g0[d * dim + d] = 1.0; in g0_qp()
153 static void g1_qu(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const PetscInt … in g1_qu() argument
156 for (d = 0; d < dim; ++d) g1[d * dim + d] = -1.0; in g1_qu()
161 static void g0_wp(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const PetscInt … in g0_wp() argument
164 for (d = 0; d < dim; ++d) g0[d * dim + d] = -1.0; in g0_wp()
168 static void g0_wd(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const PetscInt … in g0_wd() argument
171 for (c = 0; c < dim; ++c) g0[c * dim + c] = 1.0; in g0_wd()
175 static void g1_wu(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const PetscInt … in g1_wu() argument
178 for (d = 0; d < dim; ++d) g1[d * dim + d] = 1.0; in g1_wu()
218 static PetscErrorCode PerturbMesh(DM *mesh, PetscScalar *coordVals, PetscInt npoints, PetscInt dim) in PerturbMesh() argument
225 PetscCall(DMGetCoordinateDim(*mesh, &dim)); in PerturbMesh()
232 …for (k = 0; k < dim; ++k) maxPert[k] = 0.025 * (maxCoords[k] - minCoords[k]) / (PetscPowReal(npoin… in PerturbMesh()
236 for (j = 0; j < dim; ++j) { in PerturbMesh()
241 coordVals[dim * i + j] += amp; in PerturbMesh()
250 static PetscErrorCode SkewMesh(DM *mesh, PetscScalar *coordVals, PetscInt npoints, PetscInt dim) in SkewMesh() argument
259 PetscCall(PetscCalloc1(dim * dim, &transMat)); in SkewMesh()
263 for (i = 0; i < dim; ++i) { in SkewMesh()
264 for (j = 0; j < dim; ++j) { in SkewMesh()
266 if (i == j) transMat[i * dim + j] = 1.; in SkewMesh()
267 else if (j < i) transMat[i * dim + j] = 2 * (j + i) * randVal; in SkewMesh()
268 else transMat[i * dim + j] = 0; in SkewMesh()
274 for (j = 0; j < dim; ++j) { in SkewMesh()
276 for (k = 0; k < dim; ++k) tmpcoord[j] += coordVals[dim * i + k] * transMat[dim * k + j]; in SkewMesh()
278 for (l = 0; l < dim; ++l) coordVals[dim * i + l] = tmpcoord[l]; in SkewMesh()
289 PetscInt dim, npoints; in TransformMesh() local
297 PetscCall(DMGetCoordinateDim(*mesh, &dim)); in TransformMesh()
298 npoints = npoints / dim; in TransformMesh()
302 PetscCall(PerturbMesh(mesh, coordVals, npoints, dim)); in TransformMesh()
305 PetscCall(SkewMesh(mesh, coordVals, npoints, dim)); in TransformMesh()
308 PetscCall(SkewMesh(mesh, coordVals, npoints, dim)); in TransformMesh()
309 PetscCall(PerturbMesh(mesh, coordVals, npoints, dim)); in TransformMesh()
385 PetscInt dim; in SetupDiscretization() local
389 PetscCall(DMGetDimension(mesh, &dim)); in SetupDiscretization()
393 …PetscCall(PetscFECreateDefault(PetscObjectComm((PetscObject)mesh), dim, dim, simplex, "velocity_",… in SetupDiscretization()
396 …PetscCall(PetscFECreateDefault(PetscObjectComm((PetscObject)mesh), dim, 1, simplex, "pressure_", -… in SetupDiscretization()
399 …PetscCall(PetscFECreateDefault(PetscObjectComm((PetscObject)mesh), dim, 1, simplex, "divErr_", -1,… in SetupDiscretization()