code stringlengths 768 64.5k | apis sequence | extract_api stringlengths 180 29k |
|---|---|---|
import numpy as nm
from sfepy.linalg import dot_sequences
from sfepy.terms.terms import Term, terms
class DivGradTerm(Term):
r"""
Diffusion term.
:Definition:
.. math::
\int_{\Omega} \nu\ \nabla \ul{v} : \nabla \ul{u} \mbox{ , }
\int_{\Omega} \nu\ \nabla \ul{u} : \nabla \ul{w} \\
... | [
"sfepy.linalg.dot_sequences"
] | [((11757, 11785), 'numpy.ascontiguousarray', 'nm.ascontiguousarray', (['div_bf'], {}), '(div_bf)\n', (11777, 11785), True, 'import numpy as nm\n'), ((1821, 1863), 'numpy.ones', 'nm.ones', (['(1, n_qp, 1, 1)'], {'dtype': 'nm.float64'}), '((1, n_qp, 1, 1), dtype=nm.float64)\n', (1828, 1863), True, 'import numpy as nm\n')... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 28 09:33:53 2020
@author: dhulls
"""
from __future__ import print_function
from __future__ import absolute_import
from argparse import ArgumentParser
import numpy as nm
import sys
sys.path.append('.')
from sfepy.base.base import IndexedStruct, St... | [
"sfepy.discrete.Equations",
"sfepy.discrete.conditions.EssentialBC",
"sfepy.solvers.ls.ScipyDirect",
"sfepy.discrete.Equation",
"sfepy.solvers.nls.Newton",
"sfepy.discrete.conditions.Conditions",
"sfepy.discrete.fem.Mesh.from_file",
"sfepy.discrete.Integral",
"sfepy.discrete.fem.Field.from_args",
... | [((253, 273), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (268, 273), False, 'import sys\n'), ((912, 928), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (926, 928), False, 'from argparse import ArgumentParser\n'), ((1183, 1237), 'sfepy.discrete.fem.Mesh.from_file', 'Mesh.from_fi... |
r"""
Piezo-elasticity problem - linear elastic material with piezoelectric
effects.
Find :math:`\ul{u}`, :math:`\phi` such that:
.. math::
- \omega^2 \int_{Y} \rho\ \ul{v} \cdot \ul{u}
+ \int_{Y} D_{ijkl}\ e_{ij}(\ul{v}) e_{kl}(\ul{u})
- \int_{Y_2} g_{kij}\ e_{ij}(\ul{v}) \nabla_k \phi
= 0
\;, \qu... | [
"sfepy.discrete.fem.MeshIO.any_from_filename"
] | [((1055, 1080), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1070, 1080), False, 'import os\n'), ((1086, 1146), 'sfepy.discrete.fem.MeshIO.any_from_filename', 'MeshIO.any_from_filename', (['filename_mesh'], {'prefix_dir': 'conf_dir'}), '(filename_mesh, prefix_dir=conf_dir)\n', (1110, 1146)... |
#!/usr/bin/env python
"""
Convert a mesh file from one SfePy-supported format to another.
Examples::
$ ./script/convert_mesh.py meshes/3d/cylinder.mesh new.vtk
$ ./script/convert_mesh.py meshes/3d/cylinder.mesh new.vtk -s2.5
$ ./script/convert_mesh.py meshes/3d/cylinder.mesh new.vtk -s0.5,2,1
$ ./script/conve... | [
"sfepy.base.base.nm.eye",
"sfepy.base.base.nm.repeat",
"sfepy.discrete.fem.meshio.output_mesh_formats",
"sfepy.discrete.fem.Mesh.from_region",
"sfepy.discrete.fem.Mesh.from_file",
"sfepy.discrete.fem.FEDomain",
"sfepy.base.base.output",
"sfepy.discrete.fem.Mesh.from_data",
"sfepy.base.base.nm.array"... | [((665, 685), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (680, 685), False, 'import sys\n'), ((3246, 3331), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '__doc__', 'formatter_class': 'RawDescriptionHelpFormatter'}), '(description=__doc__, formatter_class=RawDescriptionHelpF... |
# This example implements macroscopic homogenized model of Biot-Darcy-Brinkman model of flow in deformable
# double porous media.
# The mathematical model is described in:
#
#<NAME>., <NAME>., <NAME>.
#The Biot-Darcy-Brinkman model of flow in deformable double porous media; homogenization and numerical modelling.
... | [
"sfepy.homogenization.micmac.get_homog_coefs_linear",
"sfepy.homogenization.utils.define_box_regions",
"sfepy.discrete.fem.mesh.Mesh.from_file"
] | [((4957, 4986), 'sfepy.discrete.fem.mesh.Mesh.from_file', 'Mesh.from_file', (['filename_mesh'], {}), '(filename_mesh)\n', (4971, 4986), False, 'from sfepy.discrete.fem.mesh import Mesh\n'), ((5012, 5049), 'os.path.join', 'osp.join', (['data_dir', '"""perf_BDB_mes.py"""'], {}), "(data_dir, 'perf_BDB_mes.py')\n", (5020, ... |
#!/usr/bin/env python
"""
Dispersion analysis of a heterogeneous finite scale periodic cell.
The periodic cell mesh has to contain two subdomains Y1 (with the cell ids 1),
Y2 (with the cell ids 2), so that different material properties can be defined
in each of the subdomains (see ``--pars`` option). The command line ... | [
"sfepy.base.conf.dict_from_string",
"sfepy.solvers.ts.TimeStepper",
"sfepy.linalg.utils.output_array_stats",
"sfepy.base.ioutils.remove_files_patterns",
"sfepy.base.base.Struct.__init__",
"sfepy.base.ioutils.ensure_path",
"sfepy.discrete.fem.periodic.set_accuracy",
"sfepy.mechanics.matcoefs.lame_from_... | [((4031, 4051), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (4046, 4051), False, 'import sys\n'), ((5102, 5210), 'sfepy.mechanics.units.apply_unit_multipliers', 'apply_unit_multipliers', (['pars', "['stress', 'one', 'density', 'stress', 'one', 'density']", 'unit_multipliers'], {}), "(pars, ['str... |
from __future__ import absolute_import
from copy import copy
import numpy as nm
from sfepy.base.testing import TestCommon
from sfepy.base.base import ordered_iteritems
from sfepy import data_dir
filename_meshes = [data_dir + '/meshes/elements/%s_2.mesh' % geom
for geom in ['1_2', '2_3', '2_4', '3_... | [
"sfepy.discrete.Variables",
"sfepy.discrete.fem.Mesh.from_file",
"sfepy.discrete.Integral",
"sfepy.discrete.fem.Field.from_args",
"sfepy.base.base.ordered_iteritems",
"sfepy.terms.Term.new",
"sfepy.solvers.ts.TimeStepper",
"sfepy.discrete.FieldVariable",
"sfepy.mechanics.tensors.dim2sym",
"sfepy.d... | [((801, 813), 'sfepy.mechanics.tensors.dim2sym', 'dim2sym', (['dim'], {}), '(dim)\n', (808, 813), False, 'from sfepy.mechanics.tensors import dim2sym\n'), ((4849, 4869), 'sfepy.discrete.Materials', 'Materials', (['materials'], {}), '(materials)\n', (4858, 4869), False, 'from sfepy.discrete import FieldVariable, Materia... |
"""
Basic uniform mesh refinement functions.
"""
import numpy as nm
from sfepy.discrete.fem import Mesh
def refine_2_3(mesh_in):
"""
Refines mesh out of triangles by cutting cutting each edge in half
and making 4 new finer triangles out of one coarser one.
"""
cmesh = mesh_in.cmesh
# Unique e... | [
"sfepy.discrete.fem.Mesh.from_data",
"sfepy.discrete.fem.FEDomain"
] | [((979, 1072), 'sfepy.discrete.fem.Mesh.from_data', 'Mesh.from_data', (["(mesh_in.name + '_r')", 'coors', 'None', '[new_conn]', '[new_mat_id]', 'mesh_in.descs'], {}), "(mesh_in.name + '_r', coors, None, [new_conn], [new_mat_id],\n mesh_in.descs)\n", (993, 1072), False, 'from sfepy.discrete.fem import Mesh\n'), ((217... |
"from __future__ import print_function\nfrom __future__ import absolute_import\nimport numpy as nm\n(...TRUNCATED) | ["sfepy.linalg.cycle","sfepy.discrete.fem.mesh.Mesh.from_data","sfepy.base.ioutils.ensure_path","sfe(...TRUNCATED) | "[((135, 155), 'sys.path.append', 'sys.path.append', (['\"\"\".\"\"\"'], {}), \"('.')\\n\", (150, 15(...TRUNCATED) |
"# 30.05.2007, c\n# last revision: 25.02.2008\nfrom __future__ import absolute_import\nfrom sfepy im(...TRUNCATED) | ["sfepy.applications.solve_pde","sfepy.linalg.rotation_matrix2d","sfepy.discrete.Material.from_conf"(...TRUNCATED) | "[((2386, 2421), 'sfepy.applications.solve_pde', 'solve_pde', (['conf'], {'save_results': '(False)'}(...TRUNCATED) |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 3