| /petsc/src/dm/partitioner/impls/simple/ |
| H A D | partsimple.c | 50 PetscInt Np = 1, Nr, np, nk, nj, ni, pk, pj, pi, ck, cj, ci, i; in PetscPartitionerPartition_Simple_Grid() local 78 …for (np = 0; np < nparts; ++np) PetscCall(PetscSectionSetDof(partSection, np, numVertices / nparts… in PetscPartitionerPartition_Simple_Grid() 81 for (np = 0; np < nparts; ++np) PetscCall(PetscSectionGetOffset(partSection, np, &offsets[np])); in PetscPartitionerPartition_Simple_Grid() 111 …np = 1; np < nparts; ++np) PetscCheck(offsets[np] - offsets[np - 1] == numVertices / nparts, PETSC… in PetscPartitionerPartition_Simple_Grid() 121 PetscInt np, *tpwgts = NULL, sumw = 0, numVerticesGlobal = 0; in PetscPartitionerPartition_Simple() local 135 for (np = 0; np < nparts; ++np) { in PetscPartitionerPartition_Simple() 136 PetscCall(PetscSectionGetDof(targetSection, np, &tpwgts[np])); in PetscPartitionerPartition_Simple() 137 sumw += tpwgts[np]; in PetscPartitionerPartition_Simple() 141 for (np = 0; np < nparts; ++np) tpwgts[np] = (tpwgts[np] * numVerticesGlobal) / sumw; in PetscPartitionerPartition_Simple() 142 for (np = 0, m = -1, mp = 0, sumw = 0; np < nparts; ++np) { in PetscPartitionerPartition_Simple() [all …]
|
| /petsc/src/binding/petsc4py/demo/legacy/ode/ |
| H A D | fastslowsplit.py | 15 import numpy as np namespace 26 u[0] = np.sqrt(2.0) 27 u[1] = np.sqrt(3.0) 32 -2.0 * (-1.0 + u[0] * u[0] - np.cos(t)) / (2.0 * u[0]) 33 + 0.05 * (-2.0 + u[1] * u[1] - np.cos(5.0 * t)) / (2.0 * u[1]) 34 - np.sin(t) / (2.0 * u[0]) 37 0.05 * (-1.0 + u[0] * u[0] - np.cos(t)) / (2.0 * u[0]) 38 - (-2.0 + u[1] * u[1] - np.cos(5.0 * t)) / (2.0 * u[1]) 39 - 5.0 * np.sin(5.0 * t) / (2.0 * u[1]) 45 -2.0 * (-1.0 + u[0] * u[0] - np.cos(t)) / (2.0 * u[0]) [all …]
|
| H A D | rober.py | 81 import numpy as np namespace 83 ii = np.asarray([v[0] for v in history]) 84 tt = np.asarray([v[1] for v in history]) 85 xx = np.asarray([v[2] for v in history]) 92 np.diff(tt),
|
| /petsc/lib/petsc/bin/ |
| H A D | PetscBinaryIO_tests.py | 19 array = np.array([1.1, 2.2, 3.3]) 28 self.assertTrue(np.allclose(array, result)) 32 array = np.array([1.1, 2.2, 3.3]) 41 self.assertTrue(np.allclose(array, vec[...])) 46 indices = np.array([3,4,5]) 64 vals = np.array([1.1,2.1,3.1]) 65 counts = np.array([0,2,3]) 66 cols = np.array([0,1,1]) 74 self.assertTrue(np.allclose(vals, result[1][2])) 81 vals = np.array([1.1,2.1,3.1]) [all …]
|
| H A D | petsc_tas_analysis.py | 2 import numpy as np namespace 421 dofs = np.array(dofs, dtype=object) 422 errors = np.array(errors, dtype=object) 424 times = np.array(times) 425 meanTime = np.array(meanTime) 426 timesMin = np.array(timesMin) 427 timeGrowthRate = np.array(timeGrowthRate) 429 flops = np.array(flops) 430 meanFlop = np.array(meanFlop) 431 flopsMax = np.array(flopsMax) [all …]
|
| H A D | PetscBinaryIO.py | 40 import numpy as np namespace 124 class Vec(np.ndarray): 135 class MatDense(np.matrix): 158 class IS(np.ndarray): 217 self._inttype = np.dtype('>i8') 219 self._inttype = np.dtype('>i4') 241 vals = np.fromfile(fh, dtype=self._scalartype, count=1) 252 nz = np.fromfile(fh, dtype=self._inttype, count=1)[0] 254 vals = np.fromfile(fh, dtype=self._scalartype, count=nz) 265 metadata = np.array([Vec._classid, len(vec)], dtype=self._inttype) [all …]
|
| H A D | PetscBinaryIOTrajectory.py | 10 import numpy as np namespace 26 t.append(np.fromfile(fh, dtype=io._scalartype, count=1)[0]) 33 nstrings = np.fromfile(fh, dtype=io._inttype, count=1)[0] 34 sizes = np.fromfile(fh, dtype=io._inttype, count=nstrings) 36 s = np.fromfile(fh, dtype=np.byte, count=sizes[i])
|
| /petsc/src/tao/leastsquares/tutorials/matlab/ |
| H A D | ProblemFinalize.m | 15 Results{SolverNumber,np}.alg = 'TAO Pounders'; 16 Results{SolverNumber,np}.problem = ['problem ' num2str(np) ' from More/Wild']; 17 Results{SolverNumber,np}.H = fvals; 18 Results{SolverNumber,np}.X = X_hist; 19 Results{SolverNumber,np}.fvecs = fvecs; 48 Results{SolverNumber,np}.alg = 'fminsearch'; 49 Results{SolverNumber,np}.problem = ['problem ' num2str(np) ' from More/Wild']; 50 Results{SolverNumber,np}.H = fvals; 51 Results{SolverNumber,np}.X = X_hist; 52 Results{SolverNumber,np}.fvecs = fvecs;
|
| H A D | ProblemInitialize.m | 3 % The taopounders driver sets np, the problem instance number 6 nprob = dfo(np,1); % Internal index for the problem 7 n = dfo(np,2); % Number of variables 8 m = dfo(np,3); % Number of residuals 12 factor_power = dfo(np,4);
|
| H A D | TestingPlot.m | 20 for np = to_solve 22 H(1:length(Results{s,np}.H),np,s) = Results{s,np}.H;
|
| /petsc/src/ksp/ksp/tests/ |
| H A D | ex22.c | 12 PetscInt n, np, i, j; in test_solve() local 18 np = 2; in test_solve() 32 PetscCall(MatMPIAIJSetPreallocation(A11, np, NULL, np, NULL)); in test_solve() 39 PetscCall(MatSetSizes(A12, PETSC_DECIDE, PETSC_DECIDE, n, np)); in test_solve() 41 PetscCall(MatSeqAIJSetPreallocation(A12, np, NULL)); in test_solve() 42 PetscCall(MatMPIAIJSetPreallocation(A12, np, NULL, np, NULL)); in test_solve() 45 for (j = 0; j < np; j++) PetscCall(MatSetValue(A12, i, j, i + j * n, INSERT_VALUES)); in test_solve() 122 PetscInt n, np, i, j; in test_solve_matgetvecs() local 130 np = 2; in test_solve_matgetvecs() 144 PetscCall(MatMPIAIJSetPreallocation(A11, np, NULL, np, NULL)); in test_solve_matgetvecs() [all …]
|
| /petsc/src/binding/petsc4py/demo/legacy/taosolve/ |
| H A D | chwirut.py | 4 import numpy as np namespace 19 np.random.seed(456) 20 x = np.random.rand(NOBSERVATIONS) 21 e = np.random.rand(NOBSERVATIONS) 23 y = np.exp(-BETA[0]*x)/(BETA[1] + BETA[2]*x) + e 45 F.array = y - np.exp(-b1*x)/(b2 + b3*x) 54 u = np.linspace(x.min(), x.max(), 100) 55 v = np.exp(-b1*u)/(b2+b3*u)
|
| /petsc/src/dm/partitioner/impls/gather/ |
| H A D | partgather.c | 16 PetscInt np; in PetscPartitionerPartition_Gather() local 21 for (np = 1; np < nparts; ++np) PetscCall(PetscSectionSetDof(partSection, np, 0)); in PetscPartitionerPartition_Gather()
|
| /petsc/src/dm/impls/swarm/ |
| H A D | swarmpic_da.c | 6 static PetscErrorCode private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular(PetscInt dim, PetscInt np[… in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() argument 16 npoints = np[0]; in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() 19 npoints = np[0] * np[1]; in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() 22 npoints = np[0] * np[1] * np[2]; in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() 25 for (d = 0; d < dim; d++) ds[d] = 2.0 / ((PetscReal)np[d]); in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() 31 for (ii = 0; ii < np[0]; ii++) { in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() 39 for (jj = 0; jj < np[1]; jj++) { in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() 40 for (ii = 0; ii < np[0]; ii++) { in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() 50 for (kk = 0; kk < np[2]; kk++) { in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() 51 for (jj = 0; jj < np[1]; jj++) { in private_DMSwarmCreateCellLocalCoords_DA_Q1_Regular() [all …]
|
| H A D | data_ex.c | 374 PetscMPIInt i, np; in _DMSwarmDataExConvertProcIdToLocalIndex() local 377 np = de->n_neighbour_procs; in _DMSwarmDataExConvertProcIdToLocalIndex() 379 for (i = 0; i < np; ++i) { in _DMSwarmDataExConvertProcIdToLocalIndex() 438 PetscMPIInt i, np; in _DMSwarmDataExInitializeTmpStorage() local 441 np = de->n_neighbour_procs; in _DMSwarmDataExInitializeTmpStorage() 442 for (i = 0; i < np; ++i) { in _DMSwarmDataExInitializeTmpStorage() 459 PetscMPIInt i, np; in DMSwarmDataExPackInitialize() local 468 np = de->n_neighbour_procs; in DMSwarmDataExPackInitialize() 471 for (i = 0; i < np; ++i) { in DMSwarmDataExPackInitialize() 486 for (i = 1; i < np; ++i) { in DMSwarmDataExPackInitialize() [all …]
|
| /petsc/src/binding/petsc4py/demo/legacy/dmplex/ |
| H A D | distribute_field.py | 11 import numpy as np namespace 15 coords = np.asarray([[0.0, 0.0], 24 cells = np.asarray([[0,1,4,3], 29 coords = np.zeros((0, 2), dtype=PETSc.RealType) 30 cells = np.zeros((0, 4), dtype=PETSc.IntType)
|
| /petsc/share/petsc/matlab/ |
| H A D | launch.m | 1 function result = launch(program,np,opt) 3 % launch(program,np) 16 np = 1; variable 25 %command = ['petscmpiexec -np ' int2str(np) ' ' program opt ' &'];
|
| /petsc/src/binding/petsc4py/demo/regressor/ |
| H A D | test_regressor_synthetic.py | 7 import numpy as np namespace 52 rows_ix = np.arange(ntr,dtype=np.int32) 53 cols_ix = np.arange(nfeature,dtype=np.int32) 69 rows_ix = np.arange(nte,dtype=np.int32) 94 plt_ind_list = np.arange(6)+231
|
| /petsc/src/binding/petsc4py/src/petsc4py/ |
| H A D | typing.py | 15 import numpy as np namespace 114 ArrayBool = NDArray[np.bool_] 117 ArrayInt = NDArray[np.integer] 120 ArrayReal = NDArray[np.floating] 123 ArrayComplex = NDArray[np.complexfloating] 126 ArrayScalar = NDArray[np.floating | np.complexfloating] 384 TSIndicatorFunction = Callable[[TS, float, Vec, NDArray[np.floating]], None] 387 TSPostEventFunction = Callable[[TS, NDArray[np.integer], float, Vec, bool], None]
|
| /petsc/src/vec/vec/tutorials/ |
| H A D | ex42.m | 1 function ex42(np,opt) 3 % ex42(np,opt) - launches ./ex42 and runs a loop 1000 times sending and then receiving a one dimen… 13 np = 1; variable 18 launch('./ex42 ',np,opt);
|
| /petsc/src/dm/tests/ |
| H A D | ex12.m | 1 function ex12(np,opt) 3 % From MATLAB run ex12(np) 16 np = 1; variable 22 launch(['./ex12 -time ' int2str(time) opt],np);
|
| /petsc/src/ksp/ksp/tutorials/ |
| H A D | ex41.m | 1 function ex41(np,opt) 3 % ex41(np,opt) - receives a matrix and vector from MATLAB via socket 14 np = 1; variable 19 launch('./ex41 ',np,opt);
|
| /petsc/src/ksp/ksp/impls/symmlq/ |
| H A D | symmlq.c | 20 PetscReal np = 0.0, s_prod; in KSPSolve_SYMMLQ() local 84 PetscCall(VecNorm(Z, NORM_2, &np)); /* np <- ||z|| */ in KSPSolve_SYMMLQ() 85 KSPCheckNorm(ksp, np); in KSPSolve_SYMMLQ() 87 PetscCall(KSPLogResidualHistory(ksp, np)); in KSPSolve_SYMMLQ() 88 PetscCall(KSPMonitor(ksp, 0, np)); in KSPSolve_SYMMLQ() 89 ksp->rnorm = np; in KSPSolve_SYMMLQ() 90 PetscCall((*ksp->converged)(ksp, 0, np, &ksp->reason, ksp->cnvP)); /* test for convergence */ in KSPSolve_SYMMLQ() 162 if (c == 0.0) np = s_prod * 1.e16; in KSPSolve_SYMMLQ() 163 else np = s_prod / PetscAbsScalar(c); /* residual norm for xc_k (CGNORM) */ in KSPSolve_SYMMLQ() 165 if (ksp->normtype != KSP_NORM_NONE) ksp->rnorm = np; in KSPSolve_SYMMLQ()
|
| /petsc/config/BuildSystem/config/packages/ |
| H A D | petsc4py.py | 89 np = self.make.make_test_np 91 np = 1 93 np = min(np,4) 95 np = self.argDB['with-petsc4py-test-np'] 96 self.addMakeMacro('PETSC4PY_NP',np)
|
| /petsc/src/binding/petsc4py/src/petsc4py/lib/_pytypes/viewer/ |
| H A D | petscpyvista.py | 2 import numpy as np namespace 80 cells = np.zeros((conesLength), dtype=np.uint32) 94 celltypes = np.zeros((cEnd - cStart), dtype=np.uint32) 97 points = np.zeros((vEnd - vStart, 3), dtype=np.float32) 122 vecs = np.zeros((scalars[1].shape[0] // scalars[2], 3)) 141 …grid.point_data["magnitudes"] = self.glyphScale * np.linalg.norm(grid.point_data[scalars[0]], axis… 160 points = np.zeros((n, 3)) 168 field = np.zeros((n,))
|