| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
import FreeCAD |
| 26 |
|
| 27 |
import Fem |
| 28 |
|
| 29 |
from . import manager |
| 30 |
from .ccx_cantilever_faceload import setup as setup_with_faceload |
| 31 |
from .manager import get_meshname |
| 32 |
from .manager import init_doc |
| 33 |
from .meshes import generate_mesh |
| 34 |
|
| 35 |
|
| 36 |
def get_information(): |
| 37 |
return { |
| 38 |
"name": "CCX cantilever hexa20 solid elements", |
| 39 |
"meshtype": "solid", |
| 40 |
"meshelement": "Hexa20", |
| 41 |
"constraints": ["fixed", "force"], |
| 42 |
"solvers": ["ccxtools", "z88"], |
| 43 |
"material": "solid", |
| 44 |
"equations": ["mechanical"], |
| 45 |
} |
| 46 |
|
| 47 |
|
| 48 |
def get_explanation(header=""): |
| 49 |
return ( |
| 50 |
header |
| 51 |
+ """ |
| 52 |
|
| 53 |
To run the example from Python console use: |
| 54 |
from femexamples.ccx_cantilever_ele_hexa20 import setup |
| 55 |
setup() |
| 56 |
|
| 57 |
|
| 58 |
See forum topic post: |
| 59 |
hexa20 elements and face load |
| 60 |
... |
| 61 |
|
| 62 |
""" |
| 63 |
) |
| 64 |
|
| 65 |
|
| 66 |
def setup(doc=None, solvertype="ccxtools"): |
| 67 |
|
| 68 |
|
| 69 |
if doc is None: |
| 70 |
doc = init_doc() |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information()))) |
| 75 |
|
| 76 |
|
| 77 |
doc = setup_with_faceload(doc, solvertype) |
| 78 |
femmesh_obj = doc.getObject(get_meshname()) |
| 79 |
|
| 80 |
|
| 81 |
if hasattr(doc, "Explanation_Report001"): |
| 82 |
doc.removeObject("Explanation_Report001") |
| 83 |
doc.recompute() |
| 84 |
|
| 85 |
|
| 86 |
from .meshes.mesh_canticcx_hexa20 import create_nodes, create_elements |
| 87 |
|
| 88 |
fem_mesh = generate_mesh.mesh_from_existing(create_nodes, create_elements) |
| 89 |
femmesh_obj.FemMesh = fem_mesh |
| 90 |
|
| 91 |
doc.recompute() |
| 92 |
return doc |