This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dolfin import * | |
from trace_tools.trace_assembler import trace_assemble | |
from trace_tools.norms import inv_interpolation_norm_eig | |
from trace_tools.embedded_mesh import EmbeddedMesh | |
from block import block_mat, block_vec | |
from block.iterative import MinRes | |
from block.algebraic.petsc import AMG | |
gamma = ['near((x[0]-0.25)*(x[0]-0.75), 0) && (0.25-DOLFIN_EPS < x[1]) && (x[1] < 0.75+DOLFIN_EPS)', |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dolfin import * | |
from numpy.random import random, choice | |
class RandomF(Expression): | |
def eval(self, values, x): | |
values[0] = random() | |
def make_random(n_cells, n_random): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Investigating higher-order CR like elements.' | |
from numpy import zeros, linspace, meshgrid, sqrt, where | |
from numpy.ma import masked_where | |
from numpy.linalg import inv | |
import matplotlib.pyplot as plt | |
def get_value(q, midpoint=(1./3, 1./3)): | |
assert 0 < q < 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
This script investigates midpoint value of nodal basis functions of Lagrange | |
finite element on [0, 1]. | |
''' | |
from numpy import zeros, linspace | |
from numpy.linalg import inv | |
import matplotlib.pyplot as plt | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "stationary_phase" | |
}, | |
"name": "stationary_phase", | |
"nbformat": 2, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
class Calculator | |
{ | |
public: | |
int operation(int a, int b) { return (this->*_operation)(a, b); } | |
void set_operation(int option) | |
{ | |
switch(option) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "pi-problem" | |
}, | |
"nbformat": 2, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", |