| 1 | # *************************************************************************** |
| 2 | # * Copyright (c) 2021 Bernd Hahnebach <[email protected]> * |
| 3 | # * * |
| 4 | # * This file is part of the FreeCAD CAx development system. * |
| 5 | # * * |
| 6 | # * This program is free software; you can redistribute it and/or modify * |
| 7 | # * it under the terms of the GNU Lesser General Public License (LGPL) * |
| 8 | # * as published by the Free Software Foundation; either version 2 of * |
| 9 | # * the License, or (at your option) any later version. * |
| 10 | # * for detail see the LICENCE text file. * |
| 11 | # * * |
| 12 | # * This program is distributed in the hope that it will be useful, * |
| 13 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 14 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 15 | # * GNU Library General Public License for more details. * |
| 16 | # * * |
| 17 | # * You should have received a copy of the GNU Library General Public * |
| 18 | # * License along with this program; if not, write to the Free Software * |
| 19 | # * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * |
| 20 | # * USA * |
| 21 | # * * |
| 22 | # *************************************************************************** |
| 23 | |
| 24 | from . import manager |
| 25 | from .ccx_cantilever_base_face import setup_cantilever_base_face |
| 26 | from .manager import init_doc |
| 27 | |
| 28 | |
| 29 | def get_information(): |
| 30 | return { |
| 31 | "name": "CCX cantilever tria6 face elements", |
| 32 | "meshtype": "face", |
| 33 | "meshelement": "Tria6", |
| 34 | "constraints": ["fixed", "force"], |
| 35 | "solvers": ["ccxtools", "z88"], |
| 36 | "material": "solid", |
| 37 | "equations": ["mechanical"], |
| 38 | } |
| 39 | |
| 40 | |
| 41 | def get_explanation(header=""): |
| 42 | return ( |
| 43 | header |
| 44 | + """ |
| 45 | |
| 46 | To run the example from Python console use: |
| 47 | from femexamples.ccx_cantilever_ele_tria6 import setup |
| 48 | setup() |
| 49 | |
| 50 | |
| 51 | See forum topic post: |
| 52 | |
| 53 | CalculiX cantilever modeled with face elements |
| 54 | |
| 55 | """ |
| 56 | ) |
| 57 | |
| 58 | |
| 59 | def setup(doc=None, solvertype="ccxtools"): |
| 60 | |
| 61 | # init FreeCAD document |
| 62 | if doc is None: |
| 63 | doc = init_doc() |
| 64 | |
| 65 | # explanation object |
| 66 | # just keep the following line and change text string in get_explanation method |
| 67 | manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information()))) |
| 68 | |
| 69 | # setup CalculiX cantilever |
| 70 | doc = setup_cantilever_base_face(doc, solvertype) |
| 71 | |
| 72 | doc.recompute() |
| 73 | return doc |