keyword
stringclasses
7 values
repo_name
stringlengths
8
98
file_path
stringlengths
4
244
file_extension
stringclasses
29 values
file_size
int64
0
84.1M
line_count
int64
0
1.6M
content
stringlengths
1
84.1M
language
stringclasses
14 values
2D
JaeHyunLee94/mpm2d
external/glfw/docs/CONTRIBUTING.md
.md
15,407
392
# Contribution Guide ## Contents - [Asking a question](#asking-a-question) - [Reporting a bug](#reporting-a-bug) - [Reporting a compile or link bug](#reporting-a-compile-or-link-bug) - [Reporting a segfault or other crash bug](#reporting-a-segfault-or-other-crash-bug) - [Reporting a context creation bug](...
Markdown
2D
JaeHyunLee94/mpm2d
external/glfw/docs/SUPPORT.md
.md
524
15
# Support resources See the [latest documentation](http://www.glfw.org/docs/latest/) for tutorials, guides and the API reference. If you have questions about using GLFW, we have a [forum](https://discourse.glfw.org/), and the `#glfw` IRC channel on [Freenode](http://freenode.net/). Bugs are reported to our [issue tr...
Markdown
2D
JaeHyunLee94/mpm2d
external/glfw/tests/monitors.c
.c
7,717
263
//======================================================================== // Monitor information tool // Copyright (c) Camilla Löwy <elmindreda@glfw.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the ...
C
2D
JaeHyunLee94/mpm2d
external/glfw/tests/reopen.c
.c
6,725
241
//======================================================================== // Window re-opener (open/close stress test) // Copyright (c) Camilla Löwy <elmindreda@glfw.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // ...
C
2D
JaeHyunLee94/mpm2d
external/glfw/tests/tearing.c
.c
7,152
251
//======================================================================== // Vsync enabling test // Copyright (c) Camilla Löwy <elmindreda@glfw.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use o...
C
2D
JaeHyunLee94/mpm2d
external/glfw/tests/iconify.c
.c
8,630
298
//======================================================================== // Iconify/restore test program // Copyright (c) Camilla Löwy <elmindreda@glfw.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from ...
C
2D
JaeHyunLee94/mpm2d
external/glfw/tests/clipboard.c
.c
3,718
146
//======================================================================== // Clipboard test program // Copyright (c) Camilla Löwy <elmindreda@glfw.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the us...
C
2D
JaeHyunLee94/mpm2d
external/glfw/tests/cursor.c
.c
14,167
489
//======================================================================== // Cursor & input mode tests // Copyright (c) Camilla Löwy <elmindreda@glfw.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the...
C
2D
JaeHyunLee94/mpm2d
external/glfw/tests/gamma.c
.c
5,607
181
//======================================================================== // Gamma correction test program // Copyright (c) Camilla Löwy <elmindreda@glfw.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from...
C
2D
JaeHyunLee94/mpm2d
external/glfw/tests/icon.c
.c
3,888
150
//======================================================================== // Window icon test program // Copyright (c) Camilla Löwy <elmindreda@glfw.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the ...
C
2D
JaeHyunLee94/mpm2d
external/glfw/tests/window.c
.c
17,238
418
//======================================================================== // Window properties test // Copyright (c) Camilla Löwy <elmindreda@glfw.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the us...
C
2D
JaeHyunLee94/mpm2d
external/glfw/tests/timeout.c
.c
2,797
99
//======================================================================== // Event wait timeout test // Copyright (c) Camilla Löwy <elmindreda@glfw.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the u...
C
2D
JaeHyunLee94/mpm2d
external/glfw/tests/empty.c
.c
3,411
133
//======================================================================== // Empty event test // Copyright (c) Camilla Löwy <elmindreda@glfw.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of t...
C
2D
JaeHyunLee94/mpm2d
external/glfw/tests/joysticks.c
.c
10,821
346
//======================================================================== // Joystick input test // Copyright (c) Camilla Löwy <elmindreda@glfw.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use o...
C
2D
JaeHyunLee94/mpm2d
external/glfw/tests/title.c
.c
2,081
73
//======================================================================== // UTF-8 window title test // Copyright (c) Camilla Löwy <elmindreda@glfw.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the u...
C
2D
JaeHyunLee94/mpm2d
external/glfw/tests/inputlag.c
.c
9,202
310
//======================================================================== // Input lag test // Copyright (c) Camilla Löwy <elmindreda@glfw.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of thi...
C
2D
JaeHyunLee94/mpm2d
external/glfw/tests/glfwinfo.c
.c
35,933
987
//======================================================================== // Context creation and information tool // Copyright (c) Camilla Löwy <elmindreda@glfw.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // aris...
C
2D
JaeHyunLee94/mpm2d
external/glfw/tests/events.c
.c
22,117
671
//======================================================================== // Event linter (event spewer) // Copyright (c) Camilla Löwy <elmindreda@glfw.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from t...
C
2D
JaeHyunLee94/mpm2d
external/glfw/tests/msaa.c
.c
6,134
221
//======================================================================== // Multisample anti-aliasing test // Copyright (c) Camilla Löwy <elmindreda@glfw.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising fro...
C
2D
JaeHyunLee94/mpm2d
external/glfw/tests/threads.c
.c
4,098
153
//======================================================================== // Multi-threading test // Copyright (c) Camilla Löwy <elmindreda@glfw.org> // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use ...
C
2D
JaeHyunLee94/mpm2d
external/glfw/tests/triangle-vulkan.c
.c
80,777
2,134
/* * Copyright (c) 2015-2016 The Khronos Group Inc. * Copyright (c) 2015-2016 Valve Corporation * Copyright (c) 2015-2016 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ...
C
2D
gvanderheide/discreteMarkovChain
setup.py
.py
1,495
45
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.rst'), enc...
Python
2D
gvanderheide/discreteMarkovChain
backup.md
.md
8,109
176
#discreteMarkovChain While for statistical and scientific programming languages such as R various packages are available for analyzing Markov chains, equivalent packages in Python are rather scarce. This discreteMarkovChain package for Python addresses the problem of obtaining the steady state distribution of a Markov...
Markdown
2D
gvanderheide/discreteMarkovChain
discreteMarkovChain/hitting_time.py
.py
1,491
72
import numpy as np from numpy import linalg as LA from discreteMarkovChain import markovChain class randomWalk(markovChain): """ A random walk where we move up and down with rate 1.0 in each state between bounds m and M. For the transition function to work well, we define some class variables in...
Python
2D
gvanderheide/discreteMarkovChain
discreteMarkovChain/__init__.py
.py
68
2
from .markovChain import markovChain from .usefulFunctions import *
Python
2D
gvanderheide/discreteMarkovChain
discreteMarkovChain/usefulFunctions.py
.py
5,174
142
from __future__ import print_function import numpy as np def uniqueStates(states,rates): """ Returns unique states and sums up the corresponding rates. States should be a 2d numpy array with on each row a state, and rates a 1d numpy array with length equal to the number of rows in states. Th...
Python
2D
gvanderheide/discreteMarkovChain
discreteMarkovChain/markovChain.py
.py
29,464
642
""" Possible fixes: -Check that the state codes do not suffer from integer overflow. -Improve memory usage. """ from __future__ import print_function import numpy as np from scipy.sparse import coo_matrix,csr_matrix, csgraph, eye, vstack, isspmatrix, isspmatrix_csr from scipy.sparse.linalg import eigs, gmres, spsolve,...
Python
2D
gvanderheide/discreteMarkovChain
discreteMarkovChain/examples.py
.py
7,470
193
from __future__ import print_function import numpy as np from markovChain import markovChain,finiteMarkovChain from usefulFunctions import partition class randomWalk(markovChain): #A random walk where we move up and down with rate 1.0 in each state between bounds m and M. #For the transition function to work w...
Python
2D
gvanderheide/discreteMarkovChain
docs/multirandomwalk.ipynb
.ipynb
5,105
229
{ "metadata": { "name": "", "signature": "sha256:505ba4c2550b28b16b276cf231b060ef5e3f50cdf4a960b88f87e937c819b046" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": [ "import numpy as np" ], "language"...
Unknown
2D
gvanderheide/discreteMarkovChain
tests/test_markovChain.py
.py
309
14
from __future__ import print_function import unittest import numpy as np from discreteMarkovChain.markovChain import markovChain class TestMarkovChain(unittest.TestCase): def test_example1(self): P = np.array([[0.5,0.5], [0.6,0.4]]) mc = markovChain(P) mc.computePi('linear')
Python
2D
gvanderheide/discreteMarkovChain
tests/__init__.py
.py
0
0
null
Python
2D
PSLer/TopRank3
TopRank3.m
.m
32,288
886
%% This code is created for performing the 2D homogenization-based topology optimization subject to multiple loading conditions %% Author: Junpeng Wang %% Copyright (c) All Rights Reserved. %% Version: 2023-11-10 %% E-mail: junpeng.wang@tum.de function [optiAlphaList, optiThetaList, optiLog, cValuesPerLoadHist] = TopRa...
MATLAB
2D
PSLer/TopRank3
Demo.m
.m
2,871
61
%% ----TopRank3---- %% Author: Junpeng Wang %% Copyright (c) All Rights Reserved. %% Version: 2023-11-10 %% E-mail: junpeng.wang@tum.de %%This repository was created for the paper "Design and Optimization of Functionally-graded Lattice Structures for Multiple Loading Conditions" %% by Junpeng Wang, Rüdiger Westermann...
MATLAB
2D
PSLer/TopRank3
supports/CreateCartesianMesh2D.m
.m
3,508
95
function meshInfo = CreateCartesianMesh2D(voxelizedModel) % __ x % / % -y % 4--------3 % | | % | | % 1--------2 % rectangular element %% initialize mesh meshInfo = MeshStruct(); [ny, nx] = size(voxelizedModel); meshInfo.resX = nx; meshInfo.resY = ny; meshInfo.boundingBox = [...
MATLAB
2D
PSLer/TopRank3
supports/ShowProblemDescription.m
.m
1,849
44
function ShowProblemDescription(meshInfo, fixingCond, loadingCond) figure; %%Design Domain xPatchs = meshInfo.nodeCoords(meshInfo.nodMapBack,1); xPatchs = xPatchs(meshInfo.eNodMat'); yPatchs = meshInfo.nodeCoords(meshInfo.nodMapBack,2); yPatchs = yPatchs(meshInfo.eNodMat'); cPatchs = zeros(size(yPatchs)); hdDesig...
MATLAB
2D
PSLer/TopRank3
supports/ShowRank3Laminate.m
.m
1,927
42
function ShowRank3Laminate(rank3LaminateParas, meshInfo, lgthScale) figure; if 6~=size(rank3LaminateParas,2), warning('Only Works with Rank-3!'); return; end alphaList = rank3LaminateParas(:,1:3); thetaList = rank3LaminateParas(:,4:6); densityField = 1-prod(1-alphaList,2); xPatchs = meshInfo.nodeCoords(meshInfo.n...
MATLAB
2D
PSLer/TopRank3
supports/ImportExternalFEAmodel.m
.m
1,846
51
function [mesh_, fixingCond_, loadingCond_] = ImportExternalFEAmodel(fileName) fid = fopen(fileName, 'r'); tmp = fscanf(fid, '%s %s', 2); domainType = fscanf(fid, '%s', 1); tmp = fscanf(fid, '%s', 1); tmp = fscanf(fid, '%d %d', 3); nelx = tmp(1); nely = tmp(2); tmp = fscanf(fid, '%s %s', 2); numEles = fscanf(fi...
MATLAB
2D
PSLer/TopRank3
supports/ShowRank3byStreamlines.m
.m
23,548
645
%% This code is to generate the domain-filling and evenly-spaced streamlines aligning with layering orientations %% This code is adapted from the publicaly available stress visualizer "3D-TSV" (https://github.com/Junpeng-Wang-TUM/3D-TSV) %% Author: Junpeng Wang (junpeng.wang@tum.de) %% Version: 2021-08-05 %% Update: 2...
MATLAB
2D
PSLer/TopRank3
supports/subsolv.m
.m
6,465
221
% This is the file subsolv.m % function [xmma,ymma,zmma,lamma,xsimma,etamma,mumma,zetmma,smma] = ... subsolv(m,n,epsimin,low,upp,alfa,beta,p0,q0,P,Q,a0,a,b,c,d); % % Written in May 1999 by % Krister Svanberg <krille@math.kth.se> % Department of Mathematics % SE-10044 Stockholm, Sweden. % % This funct...
MATLAB
2D
PSLer/TopRank3
supports/SetBoundaryElementsBePassive.m
.m
1,279
36
function passiveEles = SetBoundaryElementsBePassive(meshInfo, numLayers) %%numLayers -> 0: none passive elements passiveEles = []; if numLayers>0 index = 1; while index<=numLayers if 1==index passiveEles = double(meshInfo.elementsOnBoundary); else passiveEles = RelateAdjacentElements(meshInfo, pass...
MATLAB
2D
PSLer/TopRank3
supports/mmasub.m
.m
6,664
179
% This is the file mmasub.m % function [xmma,ymma,zmma,lam,xsi,eta,mu,zet,s,low,upp,alfa,beta] = ... mmasub(m,n,iter,xval,xmin,xmax,xold1,xold2, ... f0val,df0dx,df0dx2,fval,dfdx,dfdx2,low,upp,a0,a,c,d); % % Written in May 1999 by % Krister Svanberg <krille@math.kth.se> % Department of Mathematics % SE-10...
MATLAB
2D
hpfem/hermes-examples
2d-benchmarks-general/moving-front-space-adapt/definitions.h
.h
2,110
75
#include "hermes2d.h" using namespace Hermes; using namespace Hermes::Hermes2D; /* Exact solution */ class CustomExactSolution : public ExactSolutionScalar<double> { public: CustomExactSolution(MeshSharedPtr mesh, double x0, double x1, double y0, double y1, double* t_ptr, double s, double c)...
Unknown
2D
hpfem/hermes-examples
2d-benchmarks-general/moving-front-space-adapt/plot_graph.py
.py
334
18
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph pylab.title("DOF history") pylab.xlabel("Physical time (s)") pylab.ylabel("Number of degrees of freedom") data = numpy.loadtxt("dof_history.dat") x = data[:, 0] y = data[:, 1] plot(x, y, "-s", label="number of DOF") legend() # fi...
Python
2D
hpfem/hermes-examples
2d-benchmarks-general/moving-front-space-adapt/plot_graphs.py
.py
548
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph pylab.title("DOF history") pylab.xlabel("Physical time") pylab.ylabel("Number of degrees of freedom") data = numpy.loadtxt("dof_history_hp.dat") x = data[:, 0] y = data[:, 1] plot(x, y, "-s", label="hp-FEM") data = numpy.loadtxt("d...
Python
2D
hpfem/hermes-examples
2d-benchmarks-general/moving-front-space-adapt/main.cpp
.cpp
9,423
246
#include "definitions.h" using namespace RefinementSelectors; // This benchmark can be used to test adaptivity algorithms for transient // PDE. It has an exact solution that exhibits a moving front of arbitrary // steepness "s". Adaptivity is done in space only, i.e., the time step is // not changed during comput...
C++
2D
hpfem/hermes-examples
2d-benchmarks-general/moving-front-space-adapt/definitions.cpp
.cpp
5,928
148
#include "definitions.h" double CustomExactSolution::value(double x, double y) const { double S = s; double C = c; double t = *t_ptr; return ((x - x0)*(x - x1)*(y - y0)*(y - y1)*Hermes::atan(t)*(M_PI / 2. - Hermes::atan(S*(-t + Hermes::sqrt(x*x + y*y))))) / C; } void CustomExactSolution::derivatives(double x,...
C++
2D
hpfem/hermes-examples
2d-benchmarks-general/smooth-iso/definitions.h
.h
846
38
#include "hermes2d.h" using namespace Hermes::Hermes2D; using namespace WeakFormsH1; using Hermes::Ord; /* Exact solution */ class CustomExactSolution : public ExactSolutionScalar<double> { public: CustomExactSolution(MeshSharedPtr mesh) : ExactSolutionScalar<double>(mesh) { } virtual void derivatives(dou...
Unknown
2D
hpfem/hermes-examples
2d-benchmarks-general/smooth-iso/plot_graph.py
.py
898
42
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph pylab.yscale("log") pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") axis('equal') data = numpy.loadtxt("conv_dof_exact.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="erro...
Python
2D
hpfem/hermes-examples
2d-benchmarks-general/smooth-iso/main.cpp
.cpp
6,720
189
#include "definitions.h" using namespace Hermes; using namespace Hermes::Hermes2D; using namespace Hermes::Hermes2D::RefinementSelectors; using namespace Hermes::Hermes2D::Views; // This example shows that it makes sense to use anisotropic polynomial // degrees in quadrilateral elements. The exact solution to this ...
C++
2D
hpfem/hermes-examples
2d-benchmarks-general/smooth-iso/definitions.cpp
.cpp
574
27
#include "definitions.h" void CustomExactSolution::derivatives(double x, double y, double& dx, double& dy) const { dx = Hermes::cos(x)*Hermes::sin(y); dy = Hermes::sin(x)*Hermes::cos(y); } double CustomExactSolution::value(double x, double y) const { return Hermes::sin(x)*Hermes::sin(y); } Ord CustomExactSolut...
C++
2D
hpfem/hermes-examples
2d-benchmarks-general/layer-interior/definitions.h
.h
977
42
#include "hermes2d.h" using namespace Hermes; using namespace Hermes::Hermes2D; using namespace WeakFormsH1; using Hermes::Ord; /* Exact solution */ class CustomExactSolution : public ExactSolutionScalar<double> { public: CustomExactSolution(MeshSharedPtr mesh, double slope) : ExactSolutionScalar<doubl...
Unknown
2D
hpfem/hermes-examples
2d-benchmarks-general/layer-interior/plot_graph.py
.py
898
42
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph pylab.yscale("log") pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") axis('equal') data = numpy.loadtxt("conv_dof_exact.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="erro...
Python
2D
hpfem/hermes-examples
2d-benchmarks-general/layer-interior/main.cpp
.cpp
7,090
203
#include "definitions.h" using namespace RefinementSelectors; using namespace Views; // This is another example that allows you to compare h- and hp-adaptivity from the point of view // of both CPU time requirements and discrete problem size, look at the quality of the a-posteriori // error estimator used by Herme...
C++
2D
hpfem/hermes-examples
2d-benchmarks-general/layer-interior/definitions.cpp
.cpp
1,315
37
#include "definitions.h" double CustomExactSolution::value(double x, double y) const { return Hermes::atan(slope * (Hermes::sqrt(Hermes::sqr(x - 1.25) + Hermes::sqr(y + 0.25)) - M_PI / 3)); } void CustomExactSolution::derivatives(double x, double y, double& dx, double& dy) const { double t = Hermes::sqrt(Hermes::...
C++
2D
hpfem/hermes-examples
2d-benchmarks-general/smooth-aniso-x/definitions.h
.h
1,019
47
#include "hermes2d.h" using namespace Hermes; using namespace Hermes::Hermes2D; using namespace WeakFormsH1; using Hermes::Ord; /* Exact solution */ class CustomExactSolution : public ExactSolutionScalar<double> { public: CustomExactSolution(MeshSharedPtr mesh) : ExactSolutionScalar<double>(mesh) { } virtu...
Unknown
2D
hpfem/hermes-examples
2d-benchmarks-general/smooth-aniso-x/plot_graph.py
.py
898
42
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph pylab.yscale("log") pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") axis('equal') data = numpy.loadtxt("conv_dof_exact.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="erro...
Python
2D
hpfem/hermes-examples
2d-benchmarks-general/smooth-aniso-x/main.cpp
.cpp
6,293
174
#include "definitions.h" using namespace RefinementSelectors; // This example shows that it makes sense to use anisotropic polynomial // degrees in quadrilateral elements. The exact solution to this Poisson // problem is u(x,y) = sin(x), defined in the square (0, pi)x(0, pi). // // PDE: -Laplace u - f = 0. // // ...
C++
2D
hpfem/hermes-examples
2d-benchmarks-general/smooth-aniso-x/definitions.cpp
.cpp
975
38
#include "definitions.h" void CustomExactSolution::derivatives(double x, double y, double& dx, double& dy) const { dx = Hermes::cos(x); dy = 0; } double CustomExactSolution::value(double x, double y) const { return Hermes::sin(x); } Ord CustomExactSolution::ord(double x, double y) const { return Ord(7); } d...
C++
2D
hpfem/hermes-examples
2d-benchmarks-general/smooth-aniso-y/definitions.h
.h
1,015
46
#include "hermes2d.h" using namespace Hermes::Hermes2D; using namespace Hermes; using namespace WeakFormsH1; using Hermes::Ord; /* Exact solution */ class CustomExactSolution : public ExactSolutionScalar<double> { public: CustomExactSolution(MeshSharedPtr mesh) : ExactSolutionScalar<double>(mesh) { } virtu...
Unknown
2D
hpfem/hermes-examples
2d-benchmarks-general/smooth-aniso-y/plot_graph.py
.py
898
42
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph pylab.yscale("log") pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") axis('equal') data = numpy.loadtxt("conv_dof_exact.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="erro...
Python
2D
hpfem/hermes-examples
2d-benchmarks-general/smooth-aniso-y/main.cpp
.cpp
6,207
174
#include "definitions.h" using namespace RefinementSelectors; // This example shows that it makes sense to use anisotropic polynomial // degrees in quadrilateral elements. The exact solution to this Poisson // problem is u(x,y) = sin(y), defined in the square (0, pi)x(0, pi). // // PDE: -Laplace u = f. // // Kno...
C++
2D
hpfem/hermes-examples
2d-benchmarks-general/smooth-aniso-y/definitions.cpp
.cpp
971
38
#include "definitions.h" void CustomExactSolution::derivatives(double x, double y, double& dx, double& dy) const { dx = 0; dy = Hermes::cos(y); } double CustomExactSolution::value(double x, double y) const { return Hermes::sin(y); } Ord CustomExactSolution::ord(double x, double y) const { return Ord(7); } d...
C++
2D
hpfem/hermes-examples
2d-benchmarks-general/nonsym-check/definitions.h
.h
1,643
63
#include "hermes2d.h" using namespace Hermes::Hermes2D; using namespace WeakFormsH1; using Hermes::Ord; /* Exact solution */ class CustomExactSolution : public ExactSolutionScalar<double> { public: CustomExactSolution(MeshSharedPtr mesh) : ExactSolutionScalar<double>(mesh) { } virtual void derivatives(doub...
Unknown
2D
hpfem/hermes-examples
2d-benchmarks-general/nonsym-check/main.cpp
.cpp
6,282
176
#include "definitions.h" using namespace RefinementSelectors; // // This example uses a nonsymmetric equation and its purpose is to // check that nonsymmetric problems are solved correctly. // // PDE: -Laplace u + du/dx - (sin(x) + cos(x)) = 0. // // Known exact solution u(x,y) = sin(x). // // Domain: square dom...
C++
2D
hpfem/hermes-examples
2d-benchmarks-general/nonsym-check/definitions.cpp
.cpp
2,007
74
#include "definitions.h" void CustomExactSolution::derivatives(double x, double y, double& dx, double& dy) const { dx = Hermes::cos(x); dy = 0; } double CustomExactSolution::value(double x, double y) const { return sin(x); } Ord CustomExactSolution::ord(double x, double y) const { return Ord(20); } MeshFunc...
C++
2D
hpfem/hermes-examples
2d-benchmarks-general/lshape/definitions.h
.h
573
24
#include "hermes2d.h" using namespace Hermes::Hermes2D; using namespace WeakFormsH1; using Hermes::Ord; /* Exact solution */ class CustomExactSolution : public ExactSolutionScalar<double> { public: CustomExactSolution(MeshSharedPtr mesh) : ExactSolutionScalar<double>(mesh) { } MeshFunction<double>* clone(...
Unknown
2D
hpfem/hermes-examples
2d-benchmarks-general/lshape/plot_graph.py
.py
898
42
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph pylab.yscale("log") pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") axis('equal') data = numpy.loadtxt("conv_dof_exact.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="erro...
Python
2D
hpfem/hermes-examples
2d-benchmarks-general/lshape/plot_graph_comparison.py
.py
1,358
56
# This is a utility that produces comparison plots # of DOF and CPU convergence. To use it, your directory # must contain Hermes convergence files # conv_dof_exact_h1.dat, conv_dof_exact_h2.dat # and conv_dof_exact_hp.dat # import libraries import numpy, pylab from pylab import * # plot DOF convergence graph pylab...
Python
2D
hpfem/hermes-examples
2d-benchmarks-general/lshape/main.cpp
.cpp
6,681
183
#include "definitions.h" using namespace RefinementSelectors; // This is a standard benchmark for adaptive FEM algorithms. The exact solution is a harmonic // function in an L-shaped domain and it contains singular gradient at the re-entrant corner. // // PDE: -Laplace u = 0. // // Known exact solution, see funct...
C++
2D
hpfem/hermes-examples
2d-benchmarks-general/lshape/definitions.cpp
.cpp
720
22
#include "definitions.h" double CustomExactSolution::value(double x, double y) const { double r = Hermes::sqrt(x*x + y*y); double a = Hermes::atan2(x, y); return Hermes::pow(r, 2.0 / 3.0) * Hermes::sin(2.0*a / 3.0 + M_PI / 3); } void CustomExactSolution::derivatives(double x, double y, double& dx, double& dy) c...
C++
2D
hpfem/hermes-examples
2d-benchmarks-general/layer-boundary/definitions.h
.h
1,216
68
#include "hermes2d.h" using namespace Hermes; using namespace Hermes::Hermes2D; using namespace WeakFormsH1; using Hermes::Ord; /* Exact solution */ class CustomExactFunction { public: CustomExactFunction(double K) : K(K) {}; double uhat(double x); double duhat_dx(double x); double dduhat_dxx(double x); ...
Unknown
2D
hpfem/hermes-examples
2d-benchmarks-general/layer-boundary/plot_graph.py
.py
898
42
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph pylab.yscale("log") pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") axis('equal') data = numpy.loadtxt("conv_dof_exact.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="erro...
Python
2D
hpfem/hermes-examples
2d-benchmarks-general/layer-boundary/main.cpp
.cpp
6,693
187
#include "definitions.h" using namespace RefinementSelectors; // This singularly perturbed problem exhibits a thin boundary layer. The // exact solution facilitates convergence studies. // // PDE: -Laplace u + K*K*u - K*K + g(x,y) = 0. // // Domain: Square (-1,1)^2. // // BC: Homogeneous Dirichlet. // // Exact ...
C++
2D
hpfem/hermes-examples
2d-benchmarks-general/layer-boundary/definitions.cpp
.cpp
2,111
76
#include "definitions.h" double CustomExactFunction::uhat(double x) { return 1. - (exp(K*x) + exp(-K*x)) / (exp(K) + exp(-K)); } double CustomExactFunction::duhat_dx(double x) { return -K * (exp(K*x) - exp(-K*x)) / (exp(K) + exp(-K)); } double CustomExactFunction::dduhat_dxx(double x) { return -K*K * (exp(K*x)...
C++
2D
hpfem/hermes-examples
1d/system/definitions.h
.h
3,522
151
#include "hermes2d.h" using namespace Hermes::Hermes2D; /* Custom function that is used in the exact solution and in right-hand side */ class CustomExactFunction1 { public: CustomExactFunction1() {}; double val(double x); double dx(double x); double ddxx(double x); }; class CustomExactFunction2 { pub...
Unknown
2D
hpfem/hermes-examples
1d/system/plot_graph.py
.py
898
42
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph pylab.yscale("log") pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") axis('equal') data = numpy.loadtxt("conv_dof_exact.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="erro...
Python
2D
hpfem/hermes-examples
1d/system/main.cpp
.cpp
10,848
276
#include "definitions.h" using namespace RefinementSelectors; // This example is an analogy to the 2D tutorial example P04-adapt/03-system. // It explains how to use the multimesh adaptive hp-FEM for 1D problems whose // solution components behave very differently, so that using the same mesh // for both is a waste o...
C++
2D
hpfem/hermes-examples
1d/system/generate_equation_data.py
.py
1,375
68
from sympy import (var, exp, pprint, Eq, Symbol, Function, cos, pi, simplify, ccode, latex) var("x y") d_u = Symbol("D_u") d_v = Symbol("D_v") sigma = Symbol("SIGMA") lam = Symbol("LAMBDA") kappa = Symbol("KAPPA") k = Symbol("K") def eq1(u, v, f): return -d_u*d_u*(u.diff(x, 2) + u.diff(y, 2)) - f(u) + sig...
Python
2D
hpfem/hermes-examples
1d/system/definitions.cpp
.cpp
6,267
236
#include "definitions.h" double CustomExactFunction1::val(double x) { return cos(M_PI*x / 2); } double CustomExactFunction1::dx(double x) { return -sin(M_PI*x / 2)*(M_PI / 2.); } double CustomExactFunction1::ddxx(double x) { return -cos(M_PI*x / 2)*(M_PI / 2.)*(M_PI / 2.); } double CustomExactFunction2::val(d...
C++
2D
hpfem/hermes-examples
1d/poisson/definitions.h
.h
432
15
#include "hermes2d.h" using namespace Hermes; using namespace Hermes::Hermes2D; /* Weak forms */ class CustomWeakFormPoisson : public Hermes::Hermes2D::WeakForm<double> { public: CustomWeakFormPoisson(std::string mat_al, Hermes::Hermes1DFunction<double>* lambda_al, std::string mat_cu, Herme...
Unknown
2D
hpfem/hermes-examples
1d/poisson/main.cpp
.cpp
3,640
109
#include "definitions.h" using namespace Hermes::Hermes2D; // This example is analogous to P01-linear/03-poisson. // // PDE: Poisson equation -(LAMBDA u')' - VOLUME_HEAT_SRC = 0. // // Boundary conditions: Dirichlet u(x) = FIXED_BDY_TEMP on the boundary. // // Geometry: Interval (0, 2*pi). // // The following paramet...
C++
2D
hpfem/hermes-examples
1d/poisson/definitions.cpp
.cpp
909
17
#include "definitions.h" /* Weak forms */ CustomWeakFormPoisson::CustomWeakFormPoisson(std::string mat_al, Hermes::Hermes1DFunction<double>* lambda_al, std::string mat_cu, Hermes::Hermes1DFunction<double>* lambda_cu, Hermes::Hermes2DFunction<double>* src_term) : Hermes::Hermes2D::WeakForm<double>(1) { // Jacobi...
C++
2D
hpfem/hermes-examples
1d/moving-front/definitions.h
.h
2,139
76
#include "hermes2d.h" using namespace Hermes; using namespace Hermes::Hermes2D; /* Exact solution */ class CustomExactSolution : public ExactSolutionScalar<double> { public: CustomExactSolution(MeshSharedPtr mesh, double x0, double x1, double y0, double y1, double* t_ptr, double s, double c)...
Unknown
2D
hpfem/hermes-examples
1d/moving-front/plot_graph.py
.py
334
18
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph pylab.title("DOF history") pylab.xlabel("Physical time (s)") pylab.ylabel("Number of degrees of freedom") data = numpy.loadtxt("dof_history.dat") x = data[:, 0] y = data[:, 1] plot(x, y, "-s", label="number of DOF") legend() # fi...
Python
2D
hpfem/hermes-examples
1d/moving-front/plot_graphs.py
.py
548
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph pylab.title("DOF history") pylab.xlabel("Physical time") pylab.ylabel("Number of degrees of freedom") data = numpy.loadtxt("dof_history_hp.dat") x = data[:, 0] y = data[:, 1] plot(x, y, "-s", label="hp-FEM") data = numpy.loadtxt("d...
Python
2D
hpfem/hermes-examples
1d/moving-front/main.cpp
.cpp
10,123
263
#include "definitions.h" using namespace RefinementSelectors; // This examples is an analogy to the 2D benchmark moving-front-space-adapt. // It has an exact solution that contains a moving front with arbitrary // steepness S. The mesh changes dynamically in time. Arbitrary RK method // can be used for time integ...
C++
2D
hpfem/hermes-examples
1d/moving-front/definitions.cpp
.cpp
4,454
129
#include "definitions.h" double CustomExactSolution::value(double x, double y) const { double S = s; double C = c; double t = *t_ptr; return (x - x0) * (x - x1) * Hermes::atan(t) * (M_PI / 2. - Hermes::atan(S*(x - t))) / C; } void CustomExactSolution::derivatives(double x, double y, double& dx, double& dy) co...
C++
2D
hpfem/hermes-examples
1d/layer-boundary/definitions.h
.h
1,228
68
#include "hermes2d.h" using namespace Hermes; using namespace Hermes::Hermes2D; using namespace WeakFormsH1; using Hermes::Ord; /* Exact solution */ class CustomExactFunction { public: CustomExactFunction(double K) : K(K) {}; double uhat(double x); double duhat_dx(double x); double dduhat_dxx(double x); ...
Unknown
2D
hpfem/hermes-examples
1d/layer-boundary/plot_graph.py
.py
898
42
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph pylab.yscale("log") pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") axis('equal') data = numpy.loadtxt("conv_dof_exact.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, '-s', label="erro...
Python
2D
hpfem/hermes-examples
1d/layer-boundary/main.cpp
.cpp
8,090
213
#include "definitions.h" using namespace RefinementSelectors; // This is the 1D version of the benchmark layer-boundary. It is a // singularly perturbed problem that exhibits a thin boundary layer. // Known exact solution facilitates convergence studies. // // PDE: -u'' + K*K*u - K*K + g(x) = 0. // // Domain: In...
C++
2D
hpfem/hermes-examples
1d/layer-boundary/definitions.cpp
.cpp
2,009
75
#include "definitions.h" double CustomExactFunction::uhat(double x) { return 1. - (exp(K*x) + exp(-K*x)) / (exp(K) + exp(-K)); } double CustomExactFunction::duhat_dx(double x) { return -K * (exp(K*x) - exp(-K*x)) / (exp(K) + exp(-K)); } double CustomExactFunction::dduhat_dxx(double x) { return -K*K * (exp(K*x)...
C++
2D
hpfem/hermes-examples
doc/conf.py
.py
11,204
383
# -*- coding: utf-8 -*- # # Hermes2D documentation build configuration file, created by # sphinx-quickstart on Fri Oct 30 19:23:04 2009. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-lshape/plot_graph_cpu.py
.py
558
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_exact_h1.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.load...
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-lshape/plot_graph_dof.py
.py
568
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_exact_h1.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = ...
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-layer-interior/plot_graph_cpu.py
.py
558
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("CPU time") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_cpu_exact_h1.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = numpy.load...
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-layer-interior/plot_graph_dof.py
.py
568
26
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_exact_h1.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1)") data = ...
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-layer-boundary/plot_compar_h2.py
.py
888
42
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_exact_h2_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=2, iso)"...
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-layer-boundary/plot_compar_h1.py
.py
888
42
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_exact_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, iso)"...
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-layer-boundary/plot_compar_hp.py
.py
1,134
50
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_exact_hp_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="hp-FEM (iso)") da...
Python
2D
hpfem/hermes-examples
doc/src/hermes2d/benchmarks-general/benchmark-layer-boundary/plot_compar_iso.py
.py
1,122
50
# import libraries import numpy, pylab from pylab import * # plot DOF convergence graph axis('equal') pylab.title("Error convergence") pylab.xlabel("Degrees of freedom") pylab.ylabel("Error [%]") data = numpy.loadtxt("conv_dof_exact_h1_iso.dat") x = data[:, 0] y = data[:, 1] loglog(x, y, "-s", label="h-FEM (p=1, iso)"...
Python