Patrick Sanan
  • Member for 8 years, 11 months
  • Last seen more than a month ago
Good examples of "two is easy, three is hard" in computational sciences
2 votes

In a two-dimensional space, you can introduce complex structure, which can be used to elegantly solve many problems (e.g. potential flow problems), but no analogue exists in 3 dimensions.

View answer
PetSc vs Sundials for serial numerical computations?
3 votes

As mentioned in Geoff Oxberry's more complete answer, it should be noted that PETSc includes TSSUNDIALS, an interface to SUNDIALS. If you configure PETSc with the --download-sundials option (see ...

View answer
cost function: why use power of two ? abs(x - xhat) / x better?
2 votes

If your question is "do people sometimes use the $2$-norm to measure distances without full justification?," then the answer is probably yes. Choosing the correct norm to measure differences between ...

View answer
Bracketing a discontinuity in a step function
5 votes

See @Kirill's answer, but depending on what sort of hardware you have available, you might be able to leverage parallelism to solve the problem more quickly. For example, say you had a way to evaluate ...

View answer
1D inhomogeneous Poisson PDE with Dirichlet BCs, slow convergence
Accepted answer
2 votes

Update: the advice below is necessary, but was written just to expand on the comments above and isn't the actual issue with the code above. See the other answers. You have a discretized system $Ax=b$,...

View answer
Looking for a particular algorithm for numerical integration
3 votes

Your confusion mainly seems to be with calculus, not with numerical methods. Specifically, make sure you understand the difference between an indefinite integral and a definite integral. consider ...

View answer
Sparse matrix vector product using PETSC
Accepted answer
1 votes

I assume that you are comparing multiplication with an assembled PETSc matrix with your hand-coded matrix-free method. The latter may indeed be faster, but this could be because no entries of A need ...

View answer
How is Krylov-accelerated Multigrid (using MG as a preconditioner) motivated?
Accepted answer
12 votes

In some cases, (F)MG provides an algorithm with optimal properties. For instance, properly tuned FMG can solve some elliptic problems in a small number of "work units", where a work unit is defined to ...

View answer
How do I make sparse solvers to accept custom matvec function insted of matrix?
Accepted answer
4 votes

PETSc does this. See the documentation for MatShell and Section 3.3 in the manual.

View answer
A doubt in Multigrid V-cycle
Accepted answer
1 votes

Set $e=0$. The previous $e$ there has already been "accounted for," as you have used it to correct your solution.

View answer
Is it valid MPI-3 to nest non-blocking collectives?
Accepted answer
2 votes

Yes. The reason I asked was that with a particular implementation (cray-mpich 7.0.4), in a particular environment on a particular system, the second MPI_Wait call would not return. This was likely ...

View answer
Odd accuracy barrier in C/PETSc regarding finite elements
1 votes

For archival purposes, note that the resolution to the problem is found in the comments below the question. Data was being read from a file containing lower-precision data.

View answer
Is Discrete Exterior Calculus currently a focusing point in numerial computing world or simulation in industry,
1 votes

I'd be very interested in the answer to this question as far a HPC and general scientific computing is concerned, but there have certainly been lots of nice results in computational geometry, for ...

View answer
Non-linear ordinary differential equation in the modeling of the oscillation of a meniscus
1 votes

I'm not going to answer this question in complete detail, since it might be homework, but here are some tips on how to proceed. First, decide if there's an exact solution available. If it's linear, ...

View answer
Connections between Differential Forms and the second order Finite Volume Method
1 votes

One way to think about a differential $k$-form is "something integrable over a $k$-dimensional manifold". The most familiar example would be the volume form $dx$ in $\int_0^1 x^2 dx$, but also the $x^...

View answer
setting a condition on MATLAB ode45 output
2 votes

As described in the documentation, one can set the 'Event' property using odeset. The following (in an m-file named ode45EventTest.m) provides a barebones example of your use case, with the trivial ...

View answer