12 votes
Accepted

Motivation behind Collocation Method

I would not insist on demanding a geometrical meaning from Galerkin methods in general. There is a connection, but it becomes less meaningful as you extend it further and further. (In a sense, it ...
user avatar
9 votes
Accepted

Computer Build for Scientific Computing

Many of us in scientific computing simply have well-equipped laptops for regular software development tasks, some multicore workstations for smaller-scale testing, and access to clusters for larger ...
user avatar
7 votes
Accepted

Don't we care about the numerical diffusion in the diffusion term?

We have the following problem: $$\frac{\partial u}{\partial t}+v\color{red}{\frac{\partial u}{\partial x}}-\nu\color{blue}{\frac{\partial^2u}{\partial x^2}}=0 \tag{*}$$ The function $u$ may represent ...
user avatar
  • 1,606
7 votes
Accepted

How do I integrate a function defined over an arbitrary area?

Instead of directly integrating over the area, it is often more convenient to use the divergence theorem to replace the area integral with an integral over the boundary edges. The divergence theorem ...
user avatar
  • 5,734
7 votes

Why do we have to resort to Higher order schemes for solving the 1-D advection equation/ continuity equation?

There is a difference between the requirements for a hyperbolic pde like $$ u_t + a u_x = 0 $$ and for a purely parabolic pde like $$ u_t = u_{xx} $$ Suppose the solutions are smooth and you ...
user avatar
  • 2,983
6 votes
Accepted

Adaptive mesh refinement algorithms and the difference between AMR and moving mesh

Every major class of discretization is "open-ended" in the sense that there are decisions with no obviously/provably correct answer in the general case, so some decisions are made based on how they ...
user avatar
  • 25.2k
6 votes

What is numerical damping in the context of time-dependent FEM solvers?

It is quite straightforward to demonstrate this for implicit Euler (aka backward Euler) on a scalar example. Consider the initial value problem $$\dot{y}(t) = i \alpha y(t), \ y(0) = 1$$ with solution ...
user avatar
  • 1,198
6 votes

Space-time finite element discretization for time-dependent PDEs

Full space-time discretization of time-dependent partial differential equations is indeed a thing. If you use a structured mesh in time (in the sense that the time discretization does not depend on ...
user avatar
6 votes

How to separate text from the paper on a black and white page?

I believe the best approach here is to use a threshold based on the local average brightness of the image. Setting the threshold to be 90% of the mean value of the 11x11 grid surrounding each pixel ...
user avatar
5 votes
Accepted

Building minimization optimization problem for 2nd-order elliptic PDE

For the particular equation you are solving (called the minimal surface equation), the functional you are trying to minimize is $$ J(u) = \int_\Omega \sqrt{1 + |\nabla u|^2} \; dx. $$ You can find ...
user avatar
5 votes
Accepted

Estimating the local compression/expansion ratio for a transformation on a point cloud

If you wish to know only the change in density you are interested in the dilatation or volumetric strain of the stress tensor associated with the transformation. If you also wish to know about the ...
user avatar
5 votes
Accepted

2nd order centered finite-difference approximation of $u_{xy}$

Section 2.5 of this PDF document goes through some additional details and the error does in fact work out to be second order. The key is that the term multiplying the $\Delta y^2/\Delta x$ term is ...
user avatar
5 votes

what is the difference between non-conformal and conformal?

The concept of $p$-nonconforming meshes can also apply to continuous FEM, not just DG. For continuous FEM, continuity is enforced by enforcing a single set of degrees of freedom on a face shared ...
user avatar
  • 2,961
5 votes
Accepted

Discretization with non-constant matrix containg entries form unknown vector

You can't. Nonlinear systems of equations are in general not solvable exactly. What you need to do is to use a method to solve nonlinear systems, of which there are of course quite a lot: A simple ...
user avatar
5 votes
Accepted

Projection method FVM poisson part, adding source term

The smooth solution turned out to have BC's applied in the following way: Walls and inlet: $\frac{\partial p}{\partial n}=0$ Outlet: $p=0$ Actually thought that we need only one value of P to pin, not ...
user avatar
  • 316
4 votes
Accepted

Discrete Poisson Equation with Pure Neumann Boundary Conditions

Previous comments gave you good suggestions, I try to add some more. Firstly, your example 2x2 really does not correspond to zero Neumann boundary conditions. In fact, one can show that your choice ...
user avatar
4 votes

Finite difference discretization on a circle

The expressions you are using for eigenvalues and eigenfunctions are wrong (as per Wolfgang Bangerth's comment); therefore the results you are getting are not meaningful at all. There are analytic ...
user avatar
  • 8,287
4 votes

Adaptive mesh refinement algorithms and the difference between AMR and moving mesh

Since you are a computer science major, let me posit the following analogy: "adaptive mesh refinement" is a set of techniques for solving partial differential equations in mathematics; this is in the ...
user avatar
4 votes
Accepted

Why have specialised upwind schemes been developed to solve hyperbolic equations?

To elaborate on Wolfgang's answer: since hyperbolic PDE semi-discretizations with centered differences have purely imaginary eigenvalues, they are only neutrally stable. For linear problems (e.g., ...
user avatar
4 votes

Why have specialised upwind schemes been developed to solve hyperbolic equations?

Central differencing schemes are not stable if you have advection dominated problems. There really was no other trivial [1] alternative to developing upwind schemes. [1] There are a few other ...
user avatar
4 votes

Are FEM or DGFEM methods based on integrals or PDEs?

Basically, you have the following set of derivations: Strong form of the PDE -> Finite differences Integral form of the PDE -> Finite volumes Weak (variational) form of the PDE -> Galerkin methods (...
user avatar
4 votes
Accepted

Finite difference recursion and higher order

Short answer: yes (in exact arithmetic). You'll have to use the centered difference formula evaluated at $x \pm \frac{1}{2}\delta x$, like this: $$ u_x = \frac{u(x + \frac{1}{2}\delta x) - u(x - \...
user avatar
  • 2,096
4 votes
Accepted

Discontinuous Galerkin FEM : Control points are mid-points of edges instead of nodes

For the discontinuous Galerkin method, the choice of control points is entirely unimportant because they conceptually lie in the interior of the cell (even if they are physically on the boundary of ...
user avatar
4 votes

Is there Von Neumann stability analysis for 9-point laplacian like we have for the 5-point Laplacian?

There are actually a few different 9 point stencils in use, but they can all be written as a linear combination of the standard and skewed 5 point stencils. Performing the usual von Neumann analysis ...
user avatar
  • 2,189
4 votes
Accepted

Flux sign and face normal confusion in finite volume method

When dealing with conservation laws like your case, you can often make use of the divergence theorem (as you did). You can then express the fact that the total mass within your integration region is ...
user avatar
  • 1,936
4 votes
Accepted

Dividing a continuous domain into small squares; how to perform storage and querying?

After doing some quick research, I am convinced that the interviewer was looking for an answer related to one of the data trees. Depending on the application, one might be better than the others, but ...
user avatar
4 votes
Accepted

Can I use Q0 finite elements when there are gradients involved?

Depends on the details. If you think about the traditional $H^1$ conforming formulation with the bilinear form $(\nabla \phi, \nabla v)$ it obviously cannot work because the stiffness matrix would be ...
user avatar
  • 1,832
3 votes
Accepted

upwind schemes for solving inviscid euler equations

Do I definitely need to know the eigenvectors/eigenvalues of the system if I need to use an upwind scheme for such flow? No, it is certainly not necessary to use the full eigenstructure of the system,...
user avatar
3 votes

How can I numerically differentiate an unevenly sampled function?

The above answers are great in terms of giving you a code to use, but aren't as good in terms of theory. If you want to delve deeper into interpolating polynomials, take a look at this theoretical ...
user avatar
  • 263
3 votes

communication penalty when using wide stencils in parallel computations

I think that from a practical perspective, it's not an important point. Sure, you have less data to send around, and to fewer neighbors, but I don't think I've ever seen anyone quantify the impact in ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible