Home
last modified time | relevance | path

Searched refs:rnd (Results 1 – 22 of 22) sorted by relevance

/petsc/src/sys/classes/random/interface/
H A Drandomc.c116 static PetscErrorCode PetscRandomSetTypeFromOptions_Private(PetscRandom rnd, PetscOptionItems Petsc… in PetscRandomSetTypeFromOptions_Private() argument
123 if (((PetscObject)rnd)->type_name) { in PetscRandomSetTypeFromOptions_Private()
124 defaultType = ((PetscObject)rnd)->type_name; in PetscRandomSetTypeFromOptions_Private()
132 PetscCall(PetscRandomSetType(rnd, typeName)); in PetscRandomSetTypeFromOptions_Private()
134 PetscCall(PetscRandomSetType(rnd, defaultType)); in PetscRandomSetTypeFromOptions_Private()
159 PetscErrorCode PetscRandomSetFromOptions(PetscRandom rnd) in PetscRandomSetFromOptions() argument
165 PetscValidHeaderSpecific(rnd, PETSC_RANDOM_CLASSID, 1); in PetscRandomSetFromOptions()
167 PetscObjectOptionsBegin((PetscObject)rnd); in PetscRandomSetFromOptions()
170 PetscCall(PetscRandomSetTypeFromOptions_Private(rnd, PetscOptionsObject)); in PetscRandomSetFromOptions()
173 PetscTryTypeMethod(rnd, setfromoptions, PetscOptionsObject); in PetscRandomSetFromOptions()
[all …]
H A Drandreg.c26 PetscErrorCode PetscRandomSetType(PetscRandom rnd, PetscRandomType type) in PetscRandomSetType() argument
32 PetscValidHeaderSpecific(rnd, PETSC_RANDOM_CLASSID, 1); in PetscRandomSetType()
33 PetscCall(PetscObjectTypeCompare((PetscObject)rnd, type, &match)); in PetscRandomSetType()
37 …PetscCheck(r, PetscObjectComm((PetscObject)rnd), PETSC_ERR_ARG_UNKNOWN_TYPE, "Unknown random type:… in PetscRandomSetType()
39 PetscTryTypeMethod(rnd, destroy); in PetscRandomSetType()
40 rnd->ops->destroy = NULL; in PetscRandomSetType()
42 PetscCall((*r)(rnd)); in PetscRandomSetType()
43 PetscCall(PetscRandomSeed(rnd)); in PetscRandomSetType()
45 PetscCall(PetscObjectChangeTypeName((PetscObject)rnd, type)); in PetscRandomSetType()
64 PetscErrorCode PetscRandomGetType(PetscRandom rnd, PetscRandomType *type) in PetscRandomGetType() argument
[all …]
/petsc/src/sys/classes/random/tutorials/
H A Dex1.c14 PetscRandom rnd; in main() local
26 PetscCall(PetscRandomCreate(PETSC_COMM_WORLD, &rnd)); in main()
28 PetscCall(PetscRandomSetInterval(rnd, 0.0, 1.0)); in main()
29 PetscCall(PetscRandomSetFromOptions(rnd)); in main()
33 PetscCall(PetscRandomGetValue(rnd, &value)); in main()
46 PetscCall(PetscRandomSeed(rnd)); in main()
48 PetscCall(PetscRandomGetValue(rnd, &value)); in main()
57 PetscCall(PetscRandomDestroy(&rnd)); in main()
/petsc/src/binding/petsc4py/src/petsc4py/PETSc/
H A DRandom.pyx26 self.obj = <PetscObject*> &self.rnd
27 self.rnd = NULL
59 CHKERR(PetscRandomView(self.rnd, vwr))
71 CHKERR(PetscRandomDestroy(&self.rnd))
90 CHKERR(PetscRandomCreate(ccomm, &self.rnd))
110 CHKERR(PetscRandomSetType(self.rnd, cval))
123 CHKERR(PetscRandomGetType(self.rnd, &cval))
136 CHKERR(PetscRandomSetFromOptions(self.rnd))
149 CHKERR(PetscRandomGetValue(self.rnd, &sval))
163 CHKERR(PetscRandomGetValueReal(self.rnd, &rval))
[all …]
H A DCAPI.pyx72 setref(&retv.rnd, arg)
78 retv = ob.rnd
H A DVec.pyx2347 cdef PetscRandom rnd = NULL
2348 if random is not None: rnd = random.rnd
2349 CHKERR(VecSetRandom(self.vec, rnd))
H A DMat.pyx4281 cdef PetscRandom rnd = NULL
4282 if random is not None: rnd = random.rnd
4283 CHKERR(MatSetRandom(self.mat, rnd))
/petsc/src/ksp/ksp/tutorials/network/
H A Dex2.c44 PetscRandom rnd; in random_network() local
50 PetscCall(PetscRandomCreate(PETSC_COMM_SELF, &rnd)); in random_network()
51 PetscCall(PetscRandomSetFromOptions(rnd)); in random_network()
53 PetscCall(PetscRandomSetSeed(rnd, seed)); in random_network()
54 PetscCall(PetscRandomSeed(rnd)); in random_network()
64 PetscCall(PetscRandomSetInterval(rnd, 0.0, xmax)); in random_network()
66 PetscCall(PetscRandomGetValueReal(rnd, &x[i])); in random_network()
67 PetscCall(PetscRandomGetValueReal(rnd, &y[i])); in random_network()
78 PetscCall(PetscRandomSetInterval(rnd, 0.0, 1.0)); in random_network()
84 PetscCall(PetscRandomGetValueReal(rnd, &value)); in random_network()
[all …]
/petsc/src/dm/dt/tests/
H A Dex14.c46 PetscRandom rnd; in TestSampling() local
53 PetscCall(PetscRandomCreate(PETSC_COMM_SELF, &rnd)); in TestSampling()
54 PetscCall(PetscRandomSetInterval(rnd, 0, 1.)); in TestSampling()
55 PetscCall(PetscRandomSetFromOptions(rnd)); in TestSampling()
64 for (d = 0; d < dim[s]; ++d) PetscCall(PetscRandomGetValueReal(rnd, &r[d])); in TestSampling()
73 PetscCall(PetscRandomDestroy(&rnd)); in TestSampling()
/petsc/src/vec/vec/tests/
H A Dex2k.c31 PetscRandom rnd; in main() local
42 PetscCall(PetscRandomCreate(PETSC_COMM_WORLD, &rnd)); in main()
74 PetscCall(VecSetRandom(x, rnd)); in main()
75 for (i = 0; i < maxN; i++) PetscCall(VecSetRandom(ys[i], rnd)); in main()
118 PetscCall(PetscRandomDestroy(&rnd)); in main()
/petsc/src/mat/tutorials/
H A Dex2.c18 PetscRandom rnd; in main() local
22 PetscCall(PetscRandomCreate(PETSC_COMM_SELF, &rnd)); in main()
31 PetscCall(PetscRandomGetValue(rnd, &a[i + j * size])); in main()
114 PetscCall(PetscRandomGetValue(rnd, &v)); in main()
120 PetscCall(PetscRandomGetValue(rnd, &v)); in main()
171 PetscCall(PetscRandomDestroy(&rnd)); in main()
/petsc/src/snes/tests/
H A Dex13.c81 PetscRandom rnd; in CreateMesh() local
83 PetscCall(PetscRandomCreate(PETSC_COMM_SELF, &rnd)); in CreateMesh()
84 PetscCall(PetscRandomSetInterval(rnd, -PETSC_SQRT_MACHINE_EPSILON, PETSC_SQRT_MACHINE_EPSILON)); in CreateMesh()
85 PetscCall(PetscRandomSetFromOptions(rnd)); in CreateMesh()
90 PetscCall(PetscRandomGetValueReal(rnd, &del)); in CreateMesh()
94 PetscCall(PetscRandomDestroy(&rnd)); in CreateMesh()
/petsc/src/mat/tests/
H A Dex144.c25 PetscRandom rnd; in main() local
33 PetscCall(PetscRandomCreate(PETSC_COMM_WORLD, &rnd)); in main()
182 PetscCall(PetscRandomDestroy(&rnd)); in main()
H A Dex147.c20 PetscRandom rnd; in main() local
30 PetscRandomCreate(PETSC_COMM_WORLD, &rnd); in main()
H A Dex146.c20 PetscRandom rnd; in main() local
34 PetscRandomCreate(PETSC_COMM_WORLD, &rnd); in main()
/petsc/src/dm/impls/swarm/tests/
H A Dex2.c90 PetscRandom rnd; in PerturbVertices() local
100 PetscCall(PetscRandomCreate(PetscObjectComm((PetscObject)dm), &rnd)); in PerturbVertices()
101 PetscCall(PetscRandomSetInterval(rnd, -interval, interval)); in PerturbVertices()
102 PetscCall(PetscRandomSetFromOptions(rnd)); in PerturbVertices()
115 PetscCall(PetscRandomGetValue(rnd, &value)); in PerturbVertices()
120 PetscCall(PetscRandomDestroy(&rnd)); in PerturbVertices()
173 PetscRandom rnd, rndp; in CreateParticles() local
192 PetscCall(PetscRandomCreate(PetscObjectComm((PetscObject)dm), &rnd)); in CreateParticles()
193 PetscCall(PetscRandomSetInterval(rnd, -1.0, 1.0)); in CreateParticles()
194 PetscCall(PetscRandomSetFromOptions(rnd)); in CreateParticles()
[all …]
/petsc/src/ts/tests/
H A Dex27.c63 PetscRandom rnd, rndv; in SetInitialCoordinates() local
72 PetscCall(PetscRandomCreate(PetscObjectComm((PetscObject)sw), &rnd)); in SetInitialCoordinates()
73 PetscCall(PetscRandomSetInterval(rnd, -1.0, 1.0)); in SetInitialCoordinates()
74 PetscCall(PetscRandomSetFromOptions(rnd)); in SetInitialCoordinates()
103 PetscCall(PetscRandomGetValueReal(rnd, &refcoords[d])); in SetInitialCoordinates()
128 PetscCall(PetscRandomDestroy(&rnd)); in SetInitialCoordinates()
H A Dex28.c60 PetscRandom rnd; in SetInitialCoordinates() local
68 PetscCall(PetscRandomCreate(PetscObjectComm((PetscObject)sw), &rnd)); in SetInitialCoordinates()
69 PetscCall(PetscRandomSetInterval(rnd, -1.0, 1.0)); in SetInitialCoordinates()
70 PetscCall(PetscRandomSetFromOptions(rnd)); in SetInitialCoordinates()
102 PetscCall(PetscRandomGetValueReal(rnd, &refcoords[d])); in SetInitialCoordinates()
115 PetscCall(PetscRandomDestroy(&rnd)); in SetInitialCoordinates()
/petsc/src/dm/impls/swarm/
H A Dswarmpic.c1152 PetscRandom rnd; in DMSwarmInitializeCoordinates() local
1161 PetscCall(PetscRandomCreate(PetscObjectComm((PetscObject)dm), &rnd)); in DMSwarmInitializeCoordinates()
1162 PetscCall(PetscRandomSetInterval(rnd, -1.0, 1.0)); in DMSwarmInitializeCoordinates()
1163 PetscCall(PetscRandomSetFromOptions(rnd)); in DMSwarmInitializeCoordinates()
1176 for (d = 0; d < dim; ++d) PetscCall(PetscRandomGetValueReal(rnd, &xref[d])); in DMSwarmInitializeCoordinates()
1184 PetscCall(PetscRandomDestroy(&rnd)); in DMSwarmInitializeCoordinates()
1240 PetscRandom rnd; in DMSwarmInitializeVelocities() local
1242 PetscCall(PetscRandomCreate(PetscObjectComm((PetscObject)sw), &rnd)); in DMSwarmInitializeVelocities()
1243 PetscCall(PetscRandomSetInterval(rnd, 0, 1.)); in DMSwarmInitializeVelocities()
1244 PetscCall(PetscRandomSetFromOptions(rnd)); in DMSwarmInitializeVelocities()
[all …]
H A Dswarm.c2210 PetscRandom rnd; in DMSwarmSetPointCoordinatesRandom() local
2218 PetscCall(PetscRandomCreate(PetscObjectComm((PetscObject)dm), &rnd)); in DMSwarmSetPointCoordinatesRandom()
2219 PetscCall(PetscRandomSetInterval(rnd, -1.0, 1.0)); in DMSwarmSetPointCoordinatesRandom()
2220 PetscCall(PetscRandomSetType(rnd, PETSCRAND48)); in DMSwarmSetPointCoordinatesRandom()
2245 PetscCall(PetscRandomGetValueReal(rnd, &refcoords[d])); in DMSwarmSetPointCoordinatesRandom()
2256 PetscCall(PetscRandomDestroy(&rnd)); in DMSwarmSetPointCoordinatesRandom()
/petsc/lib/petsc/bin/maint/
H A Dtoclapack.sh621 static real rnd, eps, base;
1649 /* = 'R' or 'r', DLAMCH := rnd */
1662 /* rnd = 1.0 when rounding occurs in addition, 0.0 otherwise */
1689 rnd = 1.;
1693 rnd = 0.;
1722 rmach = rnd;
1744 /* Subroutine */ int dlamc1_(integer *beta, integer *t, logical *rnd, logical
1939 *rnd = lrnd;
1951 /* Subroutine */ int dlamc2_(integer *beta, integer *t, logical *rnd,
2248 *rnd = lrnd;
[all …]
/petsc/src/binding/petsc4py/src/petsc4py/
H A DPETSc.pxd148 cdef PetscRandom rnd