Skip to content

Instantly share code, notes, and snippets.

View dschwen's full-sized avatar

Daniel Schwen dschwen

View GitHub Profile
@dschwen
dschwen / kks-solution.ipynb
Last active August 31, 2022 15:56
KKS solution.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dschwen
dschwen / bug.c
Created October 21, 2017 03:37
Small code to demonstrate a LibJIT bug
#include <stdio.h>
#include <jit/jit.h>
#include <jit/jit-dump.h>
typedef double (*JITFunctionPtr)();
int main(int argc, char **argv)
{
jit_context_t context;
jit_type_t signature;
[AuxKernels]
[./strain_yy_block2]
type = RankTwoAux
block = 2
execute_on = TIMESTEP_END
index_i = 1
index_j = 1
rank_two_tensor = total_strain
variable = strain_yy
[../]
time C F active_time dt err nodes
0 20100.889423395 319.05426561252 0 0 0 0
1 20100.889423391 318.83276821762 55.360845 1 0.0075965095344781 16129
2.25 20100.889423394 318.46150675307 71.614685 1.25 0.10563688444898 16129
3.8125 20100.889423422 317.73157464982 87.695036 1.5625 0.082505154056021 16129
5 20100.889423415 316.8299306108 103.657809 1.1875 0.11500034320805 16129
6.5625 20100.889423412 314.74805058941 123.544943 1.5625 0.40404649011767 16129
8.515625 20100.889423425 309.07610898735 142.789786 1.953125 0.218084612125 16129
10 20100.88942343 300.44520434319 161.848667 1.484375 0.91525343285552 16129
11.953125 20100.889423222 280.56566463351 181.655184 1.953125 2.0659163872444 16129
time C F active_time dt err nodes
0 20100.889423395 319.05426561252 0 0 0 0
1 20100.889423409 318.83276821751 7.569317 1 0.007596509479426 16129
2.25 20100.889423409 318.46150675289 8.861794 1.25 0.10563688442772 16129
3.8125 20100.889423442 317.73157464948 10.111792 1.5625 0.082505153918821 16129
5 20100.889423429 316.82993061045 11.360238 1.1875 0.11500034347221 16129
6.5625 20100.889423422 314.74805058867 12.900989 1.5625 0.40404648963674 16129
8.515625 20100.889423413 309.07610898523 14.375622 1.953125 0.21808461103161 16129
10 20100.889423407 300.44520433912 15.84751 1.484375 0.91525343332448 16129
11.953125 20100.889423404 280.56566462651 17.615994 1.953125 2.0659163873453 16129
#include <iostream>
#include <vector>
template <typename T>
class ref_wrapper
{
public:
ref_wrapper() = delete;
ref_wrapper(T & obj) { ptr = &obj; }
ref_wrapper(const ref_wrapper<T> & ref) { ptr = ref.ptr; }
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string>
#include <cstdlib>
#include <cmath>
typedef double Real;
int main()

Introduction

[\int_0^1 x_i]

FirstName LastName Address1 Phone Zip Email
Dalton Skinner P.O. Box 374, 9689 Magna. Road (458) 555-0362 84125 id@Sed.org
Kirk Kidd Ap #692-3484 Phasellus Road (697) 555-6989 65844 vitae@convallisincursus.edu
Cleo Riddle P.O. Box 841, 4429 Aliquam St. (690) 555-6058 59233 arcu@nisi.org
Olga Navarro Ap #809-3508 Libero. Road (870) 555-9331 39969 rutrum.non.hendrerit@tinciduntDonec.ca
Olivia Snider P.O. Box 475, 4800 Tortor Av. (644) 555-3957 50733 sem.elit.pharetra@gravida.edu
Mira George 7043 Ligula. Av. (496) 555-6952 62383 nisi.nibh@magnaetipsum.com
Andrew Landry Ap #392-2775 Ornare Avenue (668) 555-1476 53839 Aliquam@ullamcorpernisl.edu
Colton Meyer Ap #439-2430 Nec, Street (166) 555-6210 36615 neque@inlobortis.com
Shellie Buck Ap #676-8128 Pharetra. Street (142) 555-1728 76648 dapibus@et.co.uk
@dschwen
dschwen / gist:537915784f12bf8d7f67
Last active August 29, 2015 14:22
Copy constructor shenanigans
#include <iostream>
class Base {
public:
Base() {}
Base(const Base & a) {
std::cout << "In Base\n";
}
};