# All Questions

8,358 questions
Filter by
Sorted by
Tagged with
33 views

### DirichletBC definition on boundary subdomain for component of vector valued function in FEniCS

I am trying to impose a no-outflow condition for a velocity-field over a boundary sub-boundary domain in FEniCS. What I have find challenging is imposing the condition on a component of a vector-...
53 views

51 views

### How to implement Geometric Multigrid in non-rectangular grids?

It is quite easy to implement multigrid on a rectangular grid but what about an non-rectangular?How to coarse a non-rectangular grid and apply multigrid(assume an easy non-rectangular grid capital ...
42 views

### Subspaces for Iterative methods

In the original paper of Conjugate Gradients, the authors mention that if we pick the canonical basis $\{e_1,e_2,\ldots,e_n\}$, to obtain A-orthonormal vectors, we end up with the Gaussian elimination ...
78 views

### Is expm1 the right primitive?

I'm writing some code to calculate $\int_0^1 e^{ax} \mathrm{d} x$. Annoyingly there does not seem to be a way of doing this without if statements: ...
1k views

### Runge-Kutta in the presence of an attractor

Suppose you are solving a system of equations numerically that possesses an attractor (no matter the initial conditions set, all the different solutions will approach a specific set of values that ...
26 views

### Fast approximate evaluation of Fourier-Legendre series

Suppose I know that a function from $[0,\pi] \to \mathbb{R}$ may be written as $$\sum_{k=0}^\infty A_l \frac{2l+1}{4\pi} P_l(r)$$ where $A_l$ all are known. Is there a way in which I may very ...
107 views

### fastest way to compute many small dot products

I have two n-by-3 blocks contiguous in memory ("n vectors of length 3") and I'd like to compute the dot product between each of the rows as fast as possible. In numpy, using ...
33 views

### How to use discrete cosine and discrete sine transforms in fftw

I work on fluid-related simulations. I have used FFT for fluid simulation. I want to use discrete cosine transform (DCT) and discrete sine transform (DST) to transform my velocity field to wavenumbers....
76 views

### Dynamic linear elasticity problem is stiff (numerically)

I am considering a dynamic linear elasticity problem applied to a simple structure such as a beam. In system form, the PDE can be written as $M \ddot{X} + D \dot{X} + XK = F$ where $X$ represents the ...
97 views

### How to check if my stiffness matrix is correct

I built the stiffness matrix for the Poisson equation on a 2-dimensional domain with the shape of "almost" an octagon, using pyramid basis functions. I used almost to intend the fact that I have an "...
70 views