Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/hpc-maths/GenEO
21 May 2024, 17:50:58 UTC
  • Code
  • Branches (7)
  • Releases (0)
  • Visits
Revision 9f83d7f18f7346885b67494b3124b6cf2d0228e8 authored by gouarin on 29 May 2018, 07:41:15 UTC, committed by gouarin on 29 May 2018, 07:41:15 UTC
add license file
1 parent 9acfc43
  • Files
  • Changes
    • Branches
    • Releases
    • HEAD
    • refs/github-services/pull/1/head
    • refs/github-services/pull/2/head
    • refs/github-services/pull/3/head
    • refs/heads/PCAWG
    • refs/heads/elasticity-x
    • refs/heads/master
    • refs/heads/matis
    • 9f83d7f18f7346885b67494b3124b6cf2d0228e8
    No releases to show
  • 5318502
  • /
  • notebooks
  • /
  • demo 3d.ipynb
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
  • snapshot
origin badgerevision badge
swh:1:rev:9f83d7f18f7346885b67494b3124b6cf2d0228e8
origin badgedirectory badge
swh:1:dir:3ecb0f9d2cf0aa8a6ae07873746b442467a6a111
origin badgecontent badge
swh:1:cnt:9305f406fb61666f95a075f6f4303317ed5129f2
origin badgesnapshot badge
swh:1:snp:5600c58bc442523ff2d2f69616f3f4483ec0d504

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: 9f83d7f18f7346885b67494b3124b6cf2d0228e8 authored by gouarin on 29 May 2018, 07:41:15 UTC
add license file
Tip revision: 9f83d7f
demo 3d.ipynb
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Writing demo_3d.py\n"
     ]
    }
   ],
   "source": [
    "%%file demo_3d.py\n",
    "\n",
    "from __future__ import print_function, division\n",
    "import os\n",
    "import sys, petsc4py\n",
    "petsc4py.init(sys.argv)\n",
    "import mpi4py.MPI as mpi\n",
    "from petsc4py import PETSc\n",
    "import numpy as np\n",
    "from GenEO import *\n",
    "\n",
    "def rhs(coords, rhs):\n",
    "    rhs[..., 1] = -9.81# + rand\n",
    "\n",
    "OptDB = PETSc.Options()\n",
    "Lx = OptDB.getInt('Lx', 10)\n",
    "Ly = OptDB.getInt('Ly', 1)\n",
    "Lz = OptDB.getInt('Lz', 1)\n",
    "n  = OptDB.getInt('n', 16)\n",
    "nx = OptDB.getInt('nx', Lx*n)\n",
    "ny = OptDB.getInt('ny', Ly*n)\n",
    "nz = OptDB.getInt('nz', Lz*n)\n",
    "E1 = OptDB.getReal('E1', 10**6)\n",
    "E2 = OptDB.getReal('E2', 1)\n",
    "nu1 = OptDB.getReal('nu1', 0.4)\n",
    "nu2 = OptDB.getReal('nu2', 0.4)\n",
    "\n",
    "hx = Lx/(nx - 1)\n",
    "hy = Ly/(ny - 1)\n",
    "hz = Lz/(nz - 1)\n",
    "h = [hx, hy, hz]\n",
    "\n",
    "da = PETSc.DMDA().create([nx, ny, nz], dof=3, stencil_width=1)\n",
    "da.setUniformCoordinates(xmax=Lx, ymax=Ly, zmax=Lz)\n",
    "da.setMatType(PETSc.Mat.Type.IS)\n",
    "\n",
    "path = './output_3d/'\n",
    "if mpi.COMM_WORLD.rank == 0:\n",
    "    if not os.path.exists(path):\n",
    "        os.mkdir(path)\n",
    "    else:\n",
    "        os.system('rm {}/*.vts'.format(path))\n",
    "\n",
    "class callback:\n",
    "    def __init__(self, da):\n",
    "        self.da = da\n",
    "        ranges = da.getRanges()\n",
    "        ghost_ranges = da.getGhostRanges()\n",
    "        \n",
    "        self.slices = []\n",
    "        for r, gr in zip(ranges, ghost_ranges):\n",
    "            self.slices.append(slice(gr[0], r[1]))\n",
    "        self.slices = tuple(self.slices)\n",
    "\n",
    "        self.it = 0\n",
    "\n",
    "    def __call__(self, locals):\n",
    "        pyKSP = locals['self']\n",
    "        proj = pyKSP.mpc.proj\n",
    "\n",
    "\n",
    "        if self.it == 0:\n",
    "            work, _ = proj.A.getVecs()\n",
    "            for i, vec in enumerate(proj.coarse_vecs):\n",
    "                if vec:\n",
    "                    proj.workl = vec.copy()\n",
    "                else:\n",
    "                    proj.workl.set(0.)\n",
    "                work.set(0)\n",
    "                proj.scatter_l2g(proj.workl, work, PETSc.InsertMode.ADD_VALUES)\n",
    "\n",
    "                viewer = PETSc.Viewer().createVTK(path + 'coarse_vec_{}.vts'.format(i), 'w', comm = PETSc.COMM_WORLD)\n",
    "                tmp = self.da.createGlobalVec()\n",
    "                tmpl_a = self.da.getVecArray(tmp)\n",
    "                work_a = self.da.getVecArray(work)\n",
    "                tmpl_a[:] = work_a[:]\n",
    "                tmp.view(viewer)\n",
    "                viewer.destroy()\n",
    "            self.it += 1\n",
    "\n",
    "def lame_coeff(x, y, z, v1, v2):\n",
    "    output = np.empty(x.shape)\n",
    "    mask = np.logical_or(np.logical_and(.2<=z, z<=.4),np.logical_and(.6<=z, z<=.8))\n",
    "    output[mask] = v1\n",
    "    output[np.logical_not(mask)] = v2\n",
    "    return output\n",
    "\n",
    "# non constant Young's modulus and Poisson's ratio \n",
    "E = buildCellArrayWithFunction(da, lame_coeff, (E1,E2))\n",
    "nu = buildCellArrayWithFunction(da, lame_coeff, (nu1, nu2))\n",
    "\n",
    "lamb = (nu*E)/((1+nu)*(1-2*nu)) \n",
    "mu = .5*E/(1+nu)\n",
    "\n",
    "x = da.createGlobalVec()\n",
    "b = buildRHS(da, h, rhs)\n",
    "A = buildElasticityMatrix(da, h, lamb, mu)\n",
    "A.assemble()\n",
    "\n",
    "bcApplyWest(da, A, b)\n",
    "bcopy = b.copy()\n",
    "\n",
    "pcbnn = PCBNN(A)\n",
    "\n",
    "# Set initial guess\n",
    "x.setRandom()\n",
    "xnorm = b.dot(x)/x.dot(A*x)\n",
    "x *= xnorm\n",
    "\n",
    "ksp = PETSc.KSP().create()\n",
    "ksp.setOperators(A)\n",
    "ksp.setType(ksp.Type.PYTHON)\n",
    "pyKSP = KSP_AMPCG(pcbnn)\n",
    "pyKSP.callback = callback(da)\n",
    "ksp.setPythonContext(pyKSP)\n",
    "ksp.setInitialGuessNonzero(True)\n",
    "ksp.setFromOptions()\n",
    "\n",
    "ksp.solve(b, x)\n",
    "\n",
    "viewer = PETSc.Viewer().createVTK(path + 'solution_3d.vts', 'w', comm = PETSc.COMM_WORLD)\n",
    "x.view(viewer)\n",
    "\n",
    "lamb_petsc = da.createGlobalVec()\n",
    "lamb_a = da.getVecArray(lamb_petsc)\n",
    "coords = da.getCoordinates()\n",
    "coords_a = da.getVecArray(coords)\n",
    "E = lame_coeff(coords_a[:, :, :, 0], coords_a[:, :, :, 1], coords_a[:, :, :, 2], E1, E2)\n",
    "nu = lame_coeff(coords_a[:, :, :, 0], coords_a[:, :, :, 1], coords_a[:, :, :, 2], nu1, nu2)\n",
    "\n",
    "lamb_a[:, :, :, 0] = (nu*E)/((1+nu)*(1-2*nu)) \n",
    "lamb_a[:, :, :, 1] = mpi.COMM_WORLD.rank\n",
    "lamb_petsc.view(viewer)\n",
    "\n",
    "viewer.destroy()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Subdomain number 2 contributes 6 coarse vectors as zero energy modes of local solver\n",
      "Subdomain number 3 contributes 6 coarse vectors as zero energy modes of local solver\n",
      "Subdomain number 1 contributes 6 coarse vectors as zero energy modes of local solver\n",
      "Subdomain number 0 contributes 0 coarse vectors as zero energy modes of local solver\n",
      "WARNING: The largest eigenvalue computed for GenEO_eigmax in subdomain 0 is (0.08792103741103695+0j) < the threshold which is 0.2. Consider setting PCBNN_GenEO_nev to something larger than 12\n",
      "WARNING: The largest eigenvalue computed for GenEO_eigmax in subdomain 1 is (0.04587996918296301+0j) < the threshold which is 0.2. Consider setting PCBNN_GenEO_nev to something larger than 14\n",
      "WARNING: The largest eigenvalue computed for GenEO_eigmax in subdomain 2 is (0.04587996918296301+0j) < the threshold which is 0.2. Consider setting PCBNN_GenEO_nev to something larger than 14\n",
      "GenEO eigenvalue number 0 for lambdamax in subdomain 0: (0.00027210717238778715+0j)\n",
      "GenEO eigenvalue number 1 for lambdamax in subdomain 0: (0.00028968623656886334+0j)\n",
      "GenEO eigenvalue number 2 for lambdamax in subdomain 0: (0.004659628069890074+0j)\n",
      "GenEO eigenvalue number 3 for lambdamax in subdomain 0: (0.004662790570237592+0j)\n",
      "GenEO eigenvalue number 4 for lambdamax in subdomain 0: (0.007427946211460551+0j)\n",
      "GenEO eigenvalue number 5 for lambdamax in subdomain 0: (0.0074445559391044846+0j)\n",
      "GenEO eigenvalue number 6 for lambdamax in subdomain 0: (0.023991319480995324+0j)\n",
      "GenEO eigenvalue number 7 for lambdamax in subdomain 0: (0.023992114566999734+0j)\n",
      "GenEO eigenvalue number 8 for lambdamax in subdomain 0: (0.07872691268417042+0j)\n",
      "GenEO eigenvalue number 9 for lambdamax in subdomain 0: (0.07873063971848118+0j)\n",
      "GenEO eigenvalue number 10 for lambdamax in subdomain 0: (0.08777882036336886+0j)\n",
      "GenEO eigenvalue number 11 for lambdamax in subdomain 0: (0.08792103741103695+0j)\n",
      "Subdomain number 0 contributes 12 coarse vectors after first GenEO\n",
      "This is BNN so eigmin = 1, no eigenvalue problem will be solved for eigmin\n",
      "Subdomain number 0 contributes 12 coarse vectors in total\n",
      "WARNING: The largest eigenvalue computed for GenEO_eigmax in subdomain 3 is (0.1527582349059751+0j) < the threshold which is 0.2. Consider setting PCBNN_GenEO_nev to something larger than 12\n",
      "GenEO eigenvalue number 0 for lambdamax in subdomain 1: (1.4943965693716365e-06+0j)\n",
      "GenEO eigenvalue number 1 for lambdamax in subdomain 1: (2.2484309735267134e-06+0j)\n",
      "GenEO eigenvalue number 2 for lambdamax in subdomain 1: (1.1159913381184637e-05+0j)\n",
      "GenEO eigenvalue number 3 for lambdamax in subdomain 1: (1.2644454455657916e-05+0j)\n",
      "GenEO eigenvalue number 4 for lambdamax in subdomain 1: (3.433953656439918e-05+0j)\n",
      "GenEO eigenvalue number 5 for lambdamax in subdomain 1: (4.0521819218450205e-05+0j)\n",
      "GenEO eigenvalue number 6 for lambdamax in subdomain 1: (0.012524136504701952+0j)\n",
      "GenEO eigenvalue number 7 for lambdamax in subdomain 1: (0.01253287403167038+0j)\n",
      "GenEO eigenvalue number 8 for lambdamax in subdomain 1: (0.045511195880540124+0j)\n",
      "GenEO eigenvalue number 9 for lambdamax in subdomain 1: (0.04553672984302139+0j)\n",
      "GenEO eigenvalue number 10 for lambdamax in subdomain 1: (0.04553720869837318+0j)\n",
      "GenEO eigenvalue number 11 for lambdamax in subdomain 1: (0.04561874608322997+0j)\n",
      "GenEO eigenvalue number 12 for lambdamax in subdomain 1: (0.045622261557106365+0j)\n",
      "GenEO eigenvalue number 13 for lambdamax in subdomain 1: (0.04587996918296301+0j)\n",
      "Subdomain number 1 contributes 20 coarse vectors after first GenEO\n",
      "Subdomain number 1 contributes 20 coarse vectors in total\n",
      "GenEO eigenvalue number 0 for lambdamax in subdomain 2: (1.4943965693716365e-06+0j)\n",
      "GenEO eigenvalue number 1 for lambdamax in subdomain 2: (2.2484309735267134e-06+0j)\n",
      "GenEO eigenvalue number 2 for lambdamax in subdomain 2: (1.1159913381184637e-05+0j)\n",
      "GenEO eigenvalue number 3 for lambdamax in subdomain 2: (1.2644454455657916e-05+0j)\n",
      "GenEO eigenvalue number 4 for lambdamax in subdomain 2: (3.433953656439918e-05+0j)\n",
      "GenEO eigenvalue number 5 for lambdamax in subdomain 2: (4.0521819218450205e-05+0j)\n",
      "GenEO eigenvalue number 6 for lambdamax in subdomain 2: (0.012524136504701952+0j)\n",
      "GenEO eigenvalue number 7 for lambdamax in subdomain 2: (0.01253287403167038+0j)\n",
      "GenEO eigenvalue number 8 for lambdamax in subdomain 2: (0.045511195880540124+0j)\n",
      "GenEO eigenvalue number 9 for lambdamax in subdomain 2: (0.04553672984302139+0j)\n",
      "GenEO eigenvalue number 10 for lambdamax in subdomain 2: (0.04553720869837318+0j)\n",
      "GenEO eigenvalue number 11 for lambdamax in subdomain 2: (0.04561874608322997+0j)\n",
      "GenEO eigenvalue number 12 for lambdamax in subdomain 2: (0.045622261557106365+0j)\n",
      "GenEO eigenvalue number 13 for lambdamax in subdomain 2: (0.04587996918296301+0j)\n",
      "Subdomain number 2 contributes 20 coarse vectors after first GenEO\n",
      "Subdomain number 2 contributes 20 coarse vectors in total\n",
      "GenEO eigenvalue number 0 for lambdamax in subdomain 3: (4.950913362612114e-06+0j)\n",
      "GenEO eigenvalue number 1 for lambdamax in subdomain 3: (1.931926873350419e-05+0j)\n",
      "GenEO eigenvalue number 2 for lambdamax in subdomain 3: (3.1851795098490415e-05+0j)\n",
      "GenEO eigenvalue number 3 for lambdamax in subdomain 3: (6.849472393730482e-05+0j)\n",
      "GenEO eigenvalue number 4 for lambdamax in subdomain 3: (8.416808782391296e-05+0j)\n",
      "GenEO eigenvalue number 5 for lambdamax in subdomain 3: (0.007419519611383512+0j)\n",
      "GenEO eigenvalue number 6 for lambdamax in subdomain 3: (0.116681045637096+0j)\n",
      "GenEO eigenvalue number 7 for lambdamax in subdomain 3: (0.11690279679885499+0j)\n",
      "GenEO eigenvalue number 8 for lambdamax in subdomain 3: (0.1340511856189999+0j)\n",
      "GenEO eigenvalue number 9 for lambdamax in subdomain 3: (0.13405131567845738+0j)\n",
      "GenEO eigenvalue number 10 for lambdamax in subdomain 3: (0.15263867458595137+0j)\n",
      "GenEO eigenvalue number 11 for lambdamax in subdomain 3: (0.1527582349059751+0j)\n",
      "Subdomain number 3 contributes 18 coarse vectors after first GenEO\n",
      "Subdomain number 3 contributes 18 coarse vectors in total\n",
      "There are 70 vectors in the coarse space.\n",
      "multipreconditioning initial iteration\n",
      "  0 KSP Residual norm 4.879715526063e+01 \n",
      "\tnatural_norm -> 4.07518473e+00\n",
      "\tti -> 0.00000000e+00\n",
      "  1 KSP Residual norm 1.601856581102e+02 \n",
      "\tnatural_norm -> 1.26818285e+00\n",
      "\tti -> 1.01363018e+01\n",
      "  2 KSP Residual norm 3.354429682724e+01 \n",
      "\tnatural_norm -> 2.34243292e-01\n",
      "\tti -> 4.23565872e+00\n",
      "  3 KSP Residual norm 1.308368954849e+01 \n",
      "\tnatural_norm -> 7.42688385e-02\n",
      "\tti -> 2.47389012e+00\n",
      "  4 KSP Residual norm 3.702213625230e+00 \n",
      "\tnatural_norm -> 2.07286714e-02\n",
      "\tti -> 4.03940295e+00\n",
      "  5 KSP Residual norm 1.933887183411e+00 \n",
      "\tnatural_norm -> 1.02089449e-02\n",
      "\tti -> 8.08709217e-01\n",
      "  6 KSP Residual norm 1.112954693983e+00 \n",
      "\tnatural_norm -> 7.59854971e-03\n",
      "\tti -> 3.66921342e-01\n",
      "  7 KSP Residual norm 4.747052328566e-01 \n",
      "\tnatural_norm -> 3.50322665e-03\n",
      "\tti -> 7.71452698e-01\n",
      "  8 KSP Residual norm 1.247042269859e-01 \n",
      "\tnatural_norm -> 1.00863435e-03\n",
      "\tti -> 2.48418852e+00\n",
      "  9 KSP Residual norm 7.745240355564e-02 \n",
      "\tnatural_norm -> 4.93174094e-04\n",
      "\tti -> 1.05337979e+00\n",
      " 10 KSP Residual norm 5.119202384199e-02 \n",
      "\tnatural_norm -> 3.19858407e-04\n",
      "\tti -> 4.07518636e-01\n",
      " 11 KSP Residual norm 2.073565765415e-02 \n",
      "\tnatural_norm -> 1.28931583e-04\n",
      "\tti -> 1.68871490e+00\n",
      " 12 KSP Residual norm 1.145224306262e-02 \n",
      "\tnatural_norm -> 7.65039445e-05\n",
      "\tti -> 6.80558453e-01\n",
      " 13 KSP Residual norm 4.674147033805e-03 \n",
      "\tnatural_norm -> 3.55034026e-05\n",
      "\tti -> 1.01878796e+00\n",
      " 14 KSP Residual norm 2.994668518381e-03 \n",
      "\tnatural_norm -> 2.12431166e-05\n",
      "\tti -> 3.79630670e-01\n",
      " 15 KSP Residual norm 9.717597005509e-04 \n",
      "\tnatural_norm -> 8.24665178e-06\n",
      "\tti -> 1.69338624e+00\n",
      " 16 KSP Residual norm 5.081117632336e-04 \n",
      "\tnatural_norm -> 5.84052397e-06\n",
      "\tti -> 5.99348271e-01\n",
      " 17 KSP Residual norm 3.002734160302e-04 \n",
      "\tnatural_norm -> 2.44561337e-06\n",
      "\tti -> 8.66033500e-01\n",
      " 18 KSP Residual norm 1.506771668797e-04 \n",
      "\tnatural_norm -> 1.05997555e-06\n",
      "\tti -> 1.45701266e+00\n",
      " 19 KSP Residual norm 4.833059413331e-05 \n",
      "\tnatural_norm -> 3.24905577e-07\n",
      "\tti -> 3.96088408e+00\n",
      " 20 KSP Residual norm 2.503537813954e-05 \n",
      "\tnatural_norm -> 1.72057142e-07\n",
      "\tti -> 1.31581414e+00\n",
      " 21 KSP Residual norm 1.369025117864e-05 \n",
      "\tnatural_norm -> 9.10359985e-08\n",
      "\tti -> 7.75168292e-01\n",
      " 22 KSP Residual norm 6.058998523987e-06 \n",
      "\tnatural_norm -> 4.11096140e-08\n",
      "\tti -> 1.52648452e+00\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " 23 KSP Residual norm 3.321180687944e-06 \r\n",
      "\tnatural_norm -> 2.14657371e-08\r\n",
      "\tti -> 1.08733139e+00\r\n"
     ]
    }
   ],
   "source": [
    "!mpiexec -np 4 python demo_3d.py -AMPCG_verbose -ksp_monitor -PCBNN_verbose"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "from plot import plot_solution"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "f4d50a86ad6c47a8a7aabc1522c339ed",
       "version_major": 2,
       "version_minor": 0
      },
      "text/html": [
       "<p>Failed to display Jupyter Widget of type <code>HBox</code>.</p>\n",
       "<p>\n",
       "  If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n",
       "  that the widgets JavaScript is still loading. If this message persists, it\n",
       "  likely means that the widgets JavaScript library is either not installed or\n",
       "  not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n",
       "  Widgets Documentation</a> for setup instructions.\n",
       "</p>\n",
       "<p>\n",
       "  If you're reading this message in another frontend (for example, a static\n",
       "  rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n",
       "  it may mean that your frontend doesn't currently support widgets.\n",
       "</p>\n"
      ],
      "text/plain": [
       "HBox(children=(Renderer(camera=PerspectiveCamera(position=(0.0, 0.0, 13.0), quaternion=(0.0, 0.0, 0.0, 1.0), scale=(1.0, 1.0, 1.0), up=(0.0, 1.0, 0.0)), controls=[OrbitControls(controlling=PerspectiveCamera(position=(0.0, 0.0, 13.0), quaternion=(0.0, 0.0, 0.0, 1.0), scale=(1.0, 1.0, 1.0), up=(0.0, 1.0, 0.0)))], scene=Scene(background='black', children=(Mesh(geometry=BufferGeometry(attributes={'position': <BufferAttribute shape=(1287900, 3), dtype=float32>, 'color': <BufferAttribute shape=(429300, 3, 3), dtype=float32>}), material=MeshLambertMaterial(alphaMap=None, aoMap=None, color='0xF5F5F5', emissiveMap=None, envMap=None, lightMap=None, map=None, opacity=0.5, side='DoubleSide', specularMap=None, transparent=True, vertexColors='VertexColors'), quaternion=(0.0, 0.0, 0.0, 1.0), scale=(1.0, 1.0, 1.0), up=(0.0, 1.0, 0.0)), LineSegments(geometry=BufferGeometry(attributes={'position': <BufferAttribute shape=(858600, 3), dtype=float32>}), material=LineBasicMaterial(color='0xffffff'), quaternion=(0.0, 0.0, 0.0, 1.0), scale=(1.0, 1.0, 1.0), up=(0.0, 1.0, 0.0)), AmbientLight(quaternion=(0.0, 0.0, 0.0, 1.0), scale=(1.0, 1.0, 1.0), up=(0.0, 1.0, 0.0))), fog=None, overrideMaterial=None, position=(-5.0199076638509466, 0.028396277090850464, -0.5000000234667331), quaternion=(0.0, 0.0, 0.0, 1.0), scale=(1.0, 1.0, 1.0), up=(0.0, 1.0, 0.0)), shadowMap=WebGLShadowMap()), VBox(children=(Dropdown(description='Fields', options=OrderedDict([('u', 0), ('v', 2), ('lambda', 3), ('rank', 4)]), value=0), Dropdown(description='domains', options=OrderedDict([('all', -1), ('domain 0', 0), ('domain 1', 1), ('domain 2', 2), ('domain 3', 3)]), value=-1), Dropdown(description='coarse vecs', options=OrderedDict([('none', -1), ('coarse vec 0', 0), ('coarse vec 1', 1), ('coarse vec 2', 2), ('coarse vec 3', 3), ('coarse vec 4', 4), ('coarse vec 5', 5), ('coarse vec 6', 6), ('coarse vec 7', 7), ('coarse vec 8', 8), ('coarse vec 9', 9), ('coarse vec 10', 10), ('coarse vec 11', 11), ('coarse vec 12', 12), ('coarse vec 13', 13), ('coarse vec 14', 14), ('coarse vec 15', 15), ('coarse vec 16', 16), ('coarse vec 17', 17), ('coarse vec 18', 18), ('coarse vec 19', 19), ('coarse vec 20', 20), ('coarse vec 21', 21), ('coarse vec 22', 22), ('coarse vec 23', 23), ('coarse vec 24', 24), ('coarse vec 25', 25), ('coarse vec 26', 26), ('coarse vec 27', 27), ('coarse vec 28', 28), ('coarse vec 29', 29), ('coarse vec 30', 30), ('coarse vec 31', 31), ('coarse vec 32', 32), ('coarse vec 33', 33), ('coarse vec 34', 34), ('coarse vec 35', 35), ('coarse vec 36', 36), ('coarse vec 37', 37), ('coarse vec 38', 38), ('coarse vec 39', 39), ('coarse vec 40', 40), ('coarse vec 41', 41), ('coarse vec 42', 42), ('coarse vec 43', 43), ('coarse vec 44', 44), ('coarse vec 45', 45), ('coarse vec 46', 46), ('coarse vec 47', 47), ('coarse vec 48', 48), ('coarse vec 49', 49), ('coarse vec 50', 50), ('coarse vec 51', 51), ('coarse vec 52', 52), ('coarse vec 53', 53), ('coarse vec 54', 54), ('coarse vec 55', 55), ('coarse vec 56', 56), ('coarse vec 57', 57), ('coarse vec 58', 58), ('coarse vec 59', 59), ('coarse vec 60', 60), ('coarse vec 61', 61), ('coarse vec 62', 62), ('coarse vec 63', 63), ('coarse vec 64', 64), ('coarse vec 65', 65), ('coarse vec 66', 66), ('coarse vec 67', 67), ('coarse vec 68', 68), ('coarse vec 69', 69)]), value=-1), Checkbox(value=True, description='Show displacement'), Checkbox(value=True, description='Show mesh'), IntSlider(value=100, continuous_update=False, description='Scale factor for coarse vec displacement', max=1000, min=1)))))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_solution('output_3d', 'solution_3d.vts')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API