Marsupilami Documentation
Transcription
Marsupilami Documentation
Marsupilami Documentation Release 0.x.0 Lionel du Peloux November 30, 2015 Contents 1 Overview 1.1 Motivating Example . . 1.2 Installation Instructions 1.3 References . . . . . . . 1.4 Credits . . . . . . . . . . . . . 3 3 3 3 3 2 Learning and Teaching 2.1 Simple cable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Simple Elastica . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 C# API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 5 5 5 3 Theory 3.1 Overview . . . . . . 3.2 Darboux Vector . . . 3.3 Dynamic relaxation 3.4 Elements . . . . . . 7 7 7 7 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Simple Catenary 9 5 Simple Elastica 5.1 Simple cable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Simple Elastica . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3 C# API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 11 11 11 6 Spheric Gridshell 6.1 The compas methode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 Formfinding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.3 Bracing Impact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 13 13 13 7 Development 7.1 Get Involved . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2 Open source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.3 Ressources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 15 15 15 8 Autodoc SetUp : WIP 8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2 Environnement Virtuel (python) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.3 Générer la doc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 17 17 18 i 9 API autodoc (WIP) 9.1 Test handwritten doc (sphinxcontrib-dotnetdomain) . 9.2 Dynamic Relaxation (breathe) . . . . . . . . . . . . 9.3 Element (breathe) . . . . . . . . . . . . . . . . . . 9.4 Utility (breathe) . . . . . . . . . . . . . . . . . . . 10 Indices and tables ii . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 19 20 22 24 25 Marsupilami Documentation, Release 0.x.0 Marsupilami is a non linear solver for networks of beams, bars and cables. It is based on a dynamic relaxation algorithm. The main documentation for the site is organized into a couple sections: • User Documentation • Examples and Tutorials • Developer Documentation Contents 1 Marsupilami Documentation, Release 0.x.0 2 Contents CHAPTER 1 Overview Marsupilami is a non linear solver for networks of beams, bars and cables. It is based on a dynamic relaxation algorithm. 1.1 Motivating Example using Rhino x = rand(1000, 1000) r = sum(x, 2) 1.2 Installation Instructions Marsupilami is a .Net libray written in C#. It has some dependencies : - Rhinoceros 5 - Grasshopper - Math.NET numerics - Intel MKL 1.3 References 1.4 Credits Laboratoire Navier 2010 - Lionel du Peloux 3 Marsupilami Documentation, Release 0.x.0 4 Chapter 1. Overview CHAPTER 2 Learning and Teaching Marsupilami is a non linear solver for networks of beams, bars and cables. It is based on a dynamic relaxation algorithm. 2.1 Simple cable using Rhino x = rand(1000, 1000) r = sum(x, 2) 2.2 Simple Elastica 2.3 C# API 5 Marsupilami Documentation, Release 0.x.0 6 Chapter 2. Learning and Teaching CHAPTER 3 Theory Marsupilami is a non linear solver for networks of beams, bars and cables. It is based on a dynamic relaxation algorithm. 3.1 Overview Darboux vector Those equations can be formulated with the emph{Darboux vector} of the chosen material frame, which represents the rotational velocity of the frame along 𝑥(𝑠) : 3.2 Darboux Vector ⎡ 𝑑′𝑖 (𝑠) = Ω𝑚 (𝑠) × 𝑑𝑖 (𝑠) , ⎤ 𝜏 (𝑠) Ω𝑚 (𝑠) = ⎣𝜅1 (𝑠)⎦ 𝜅2 (𝑠) 3.3 Dynamic relaxation 3.4 Elements 7 Marsupilami Documentation, Release 0.x.0 8 Chapter 3. Theory CHAPTER 4 Simple Catenary Tutorial over the calssic problem of the catenary / hanging chaine. 9 Marsupilami Documentation, Release 0.x.0 10 Chapter 4. Simple Catenary CHAPTER 5 Simple Elastica Tutorial over the calssic problem of the elastica 5.1 Simple cable using Rhino x = rand(1000, 1000) r = sum(x, 2) 5.2 Simple Elastica 5.3 C# API 11 Marsupilami Documentation, Release 0.x.0 12 Chapter 5. Simple Elastica CHAPTER 6 Spheric Gridshell Tutorial over a simple spherical elastic gridshell. 6.1 The compas methode 6.2 Formfinding 6.3 Bracing Impact 13 Marsupilami Documentation, Release 0.x.0 14 Chapter 6. Spheric Gridshell CHAPTER 7 Development Marsupilami is a non linear solver for networks of beams, bars and cables. It is based on a dynamic relaxation algorithm. reST <http://openalea.gforge.inria.fr/doc/openalea/doc/_build/html/source/sphinx/rest_syntax.html> 7.1 Get Involved Directives to contribut. Pull request via GitHub. 7.2 Open source 7.3 Ressources • GitHub • Read the doc • McNeel 15 Marsupilami Documentation, Release 0.x.0 16 Chapter 7. Development CHAPTER 8 Autodoc SetUp : WIP 8.1 Introduction Plusieurs solutions ont été testées pour réaliser une doc automatique façon “API” à partir de sphinx. En effet, sphinx dispose d’un module autodoc mais celui-ci est reservé à python. Cependant, sphinx permet l’ajout de domain pour cibler d’autres langages. Pour .NET, une tentative existe mais n’est qu’en verison alpha à ce jour : • sphinxcontrib-dotnetdomain : un domain pour sphinx prenant en charge .Net (édité par RTD) • sphinx-autoapi : une extension sphinx pour générer de la doc façon “API” automatiquement, avec prise en compte .Net (édité par RTD) • sphinx-autoapi needs docfx • breathe : une extension sphinx pour faire le lien entre doxygen et sphinx (actuellement en place, mais orienté C++, ne semble pas très bien adapté pour le C#) • doxygen : utilitaire avec interface graphique qui permet de générer un autodoc façon “API” à partir d’un code Csharp. Fonctionne très bien. Pas d’intégration en standard avec sphinx. • Je devrais jetter un coup d’oeil également à MKDocs Tout celà fonctionne avec python. Pour s’affranchir de difficultées liées à de multiples installations python, un virtualenv a été mis en place au sein du dossier manual. Note: Un virtualenv n’est autre qu’une distribution locale et isolée de python dans laquelle on peut se placer pour travailler. Idéal pour les problèmes liés aux liens symbolics lorsqu’on a de multiples versions de python sur la même machine. 8.2 Environnement Virtuel (python) Installer virtualenv pour la distribution python utilisée par défaut pour le système avec pip (la commande sudo permet d’executer la commande avec les privilèges admin si nécessaire): $ [sudo] pip install virtualenv Créer un environnement virtuel dans le dossier. ../Marsupilami/doc/manual/_virtualenv avec la commande suivante: $ virtualenv ../Marsupilami/doc/manual/_virtualenv 17 Marsupilami Documentation, Release 0.x.0 Se placer dans cet environnement virtuel avec la commande suivante: $ source ../Marsupilami/doc/manual/_virtualenv/bin/activate Note: L’invite de commande du terminal change alors de nom pour montrer que les appels pythons se feront désormais à partir de cet environnement virtuel. Dans cet envrionnement virtuel, installer les packages requis: $ $ $ $ pip pip pip pip install install install install sphinx breathe sphinxcontrib-dotnetdomain sphinx-autoapi Vérifier les modules installés en appelant la commande: $ pip list 8.3 Générer la doc La doc est générée : • à partir des fichiers .rst du dossier ../Marsupilami/doc/manual/ • à partir des fichiers xml générés par ../Marsupilami/doc/manual/_doxygen/ doxygen et situés dans le dossier Un mémo REST est disponible sur RTD. La génération de la XML doc (et d’un HTML façon “API”) avec doxygen est sans soucis. La configuration de breathe se fait dans le fichier conf.py du projet sphinx: extensions = ['sphinx.ext.autodoc','autoapi.extension','sphinxcontrib.dotnetdomain','breathe'] breathe_projects = { "Marsupilami": "../manual/_doxygen/xml/" } breathe_default_members = ('members', 'undoc-members','protected-members','private-members') breathe_default_project = 'Marsupilami' Une fois placé dans l’environnement python virtuel, se placer dans le dossier ../Marsupilami/doc/manual/ et invoquer la commande (selon les cas): $ make html $ make clean html Autre point d’aide pour breathe : tuto 18 Chapter 8. Autodoc SetUp : WIP CHAPTER 9 API autodoc (WIP) 9.1 Test handwritten doc (sphinxcontrib-dotnetdomain) This should be available in a near futur with autodoc capabilities with the sphinx-autoapi (WIP). method(FooType bar) Arguments • bar (Bar) – A Bar instance Returns Altered bar instance On Foo instance, return Bar instance class protected static ValidClass MethodNoArgs() MethodArg(T1) Arguments • T1 – Version slug to use for node lookup MethodArgs(T1, T2) Arguments • T1 – desciption T1 • T2 – desciption T2 method(FooType bar) Arguments • bar (Bar) – A Bar instance Returns Altered bar instance MethodNested(List<int>, Dictionary<string, List<int>>) Foobar() Setter Getter Foobar() Adder Remover namespace ValidNamespace class ValidClass 19 Marsupilami Documentation, Release 0.x.0 struct ValidStructure interface ValidInterface ValidProperty() ValidField() ValidEvent() ValidOperator() namespace ValidNamespace class ValidNamespace.Foobar<T> class ValidNamespace.Foobar<T,T> class ValidNamespace.Foobar<TFoo,TBar> class ValidNamespace.Foobar<T,<string>> class ValidNamespace.Foobar<T,<T,<string>>> NestedProperty() NestedField() NestedEvent() NestedOperator() class ValidNamespace.NestedClass NestedClassProperty() NestedClassField() NestedClassEvent() NestedClassOperator() 9.2 Dynamic Relaxation (breathe) class Marsupilami::Kernel::DRRelax Dynamic Relaxation alogithm with kinetic damping (autodoc) Public Functions DRRelax(DRElement [] elements, List< DRConstraint > constraints) void Run() List<string> Info() DataTree<Vector3d> GHTree_Xt() DataTree<Vector3d> GHTree_Xi() DataTree<Vector3d> GHTree_Vt() DataTree<Vector3d> GHTree_Rt() 20 Chapter 9. API autodoc (WIP) Marsupilami Documentation, Release 0.x.0 DataTree<Vector3d> GHTree_Fext() DataTree<GH_Number> GHTree_LMt() DataTree<GH_Number> GHTree_N() DataTree<GH_Number> GHTree_T() DataTree<GH_Number> GHTree_M() Public Members int numIteration int numPic int numCurrentPicIterations List<int> iterationHistory List<double> chronoHistory Stopwatch chrono Property property Marsupilami::Kernel::DRRelax::CountElements property Marsupilami::Kernel::DRRelax::CountNodes property Marsupilami::Kernel::DRRelax::Ect property Marsupilami::Kernel::DRRelax::Ec0 property Marsupilami::Kernel::DRRelax::Ec1 property Marsupilami::Kernel::DRRelax::Eclim property Marsupilami::Kernel::DRRelax::dt property Marsupilami::Kernel::DRRelax::Fext property Marsupilami::Kernel::DRRelax::Xi property Marsupilami::Kernel::DRRelax::Xt property Marsupilami::Kernel::DRRelax::Vt property Marsupilami::Kernel::DRRelax::Rt property Marsupilami::Kernel::DRRelax::LMt property Marsupilami::Kernel::DRRelax::Elements Private Functions void Init() void Reset() void InterpolateEc(double E0, double E1, double E2) void Update_F() 9.2. Dynamic Relaxation (breathe) 21 Marsupilami Documentation, Release 0.x.0 Private Members double _Eclim double _Ect double _Ec0 double _Ec1 double _dt int numElements int numNodes Vector3d [][] _Xi Vector3d [][] _Fext Vector3d [][] _Xt Vector3d [][] _Vt Vector3d [][] _Rt double [][] _LMt DRElement [] elements double q Vector3d [][] Vtmp DRConstraint [] constraints DRKinematicConstraint [] kinematicConstraints DRMechanicalConstraint [] mechanicalConstraints DRLinkConstraint [] linkConstraints 9.3 Element (breathe) class Marsupilami::Kernel::DRElement Public Functions virtual abstract override string ToString() = 0 virtual abstract void Update_R(ref Vector3d Rt[][], ref Vector3d Fext[][], ref Vector3 virtual abstract void Update_LM(ref double LMt[][]) = 0 Vector3d [] X(ref Vector3d Xt[][]) Vector3d [] V(ref Vector3d Vt[][]) Vector3d [] R(ref Vector3d Rt[][]) Vector3d [] F(ref Vector3d Fext[][]) double [] LM(ref double LMt[][]) 22 Chapter 9. API autodoc (WIP) Marsupilami Documentation, Release 0.x.0 virtual abstract double [] N() = 0 virtual abstract double [] T() = 0 virtual abstract double [] M() = 0 Property property Marsupilami::Kernel::DRElement::Count property Marsupilami::Kernel::DRElement::Index property Marsupilami::Kernel::DRElement::Name property Marsupilami::Kernel::DRElement::Type property Marsupilami::Kernel::DRElement::E property Marsupilami::Kernel::DRElement::S property Marsupilami::Kernel::DRElement::I property Marsupilami::Kernel::DRElement::ES property Marsupilami::Kernel::DRElement::EI property Marsupilami::Kernel::DRElement::Xi property Marsupilami::Kernel::DRElement::L0 property Marsupilami::Kernel::DRElement::Fext property Marsupilami::Kernel::DRElement::Lt property Marsupilami::Kernel::DRElement::X12 property Marsupilami::Kernel::DRElement::N12 property Marsupilami::Kernel::DRElement::M12 property Marsupilami::Kernel::DRElement::F1 property Marsupilami::Kernel::DRElement::F2 property Marsupilami::Kernel::DRElement::dt property Marsupilami::Kernel::DRElement::g Protected Functions DRElement(int index, Vector3d[] Xi, double[] L0, Vector3d[] Fext, double dt) Protected Attributes double alpha double k double lm 9.3. Element (breathe) 23 Marsupilami Documentation, Release 0.x.0 Private Members int _numNodes int _index ElementTypes _type string _name double _E double _S double _I double _ES double _EI Vector3d [] _Xi Vector3d [] _Fext double [] _L0 double [] _Lt Vector3d [] _X12 Vector3d [] _N12 Vector3d [] _M12 Vector3d [] _F1 Vector3d [] _F2 double _dt double _g 9.4 Utility (breathe) class Marsupilami::Kernel::Utility 24 Chapter 9. API autodoc (WIP) CHAPTER 10 Indices and tables • genindex • search 25 Marsupilami Documentation, Release 0.x.0 26 Chapter 10. Indices and tables Index Symbols K _E (C++ member), 24 _EI (C++ member), 24 _ES (C++ member), 24 _Ec0 (C++ member), 22 _Ec1 (C++ member), 22 _Eclim (C++ member), 22 _Ect (C++ member), 22 _I (C++ member), 24 _S (C++ member), 24 _dt (C++ member), 22, 24 _g (C++ member), 24 _index (C++ member), 24 _name (C++ member), 24 _numNodes (C++ member), 24 _type (C++ member), 24 k (C++ member), 23 A alpha (C++ member), 23 C chrono (C++ member), 21 chronoHistory (C++ member), 21 G GHTree_Fext (C++ function), 20 GHTree_LMt (C++ function), 21 GHTree_M (C++ function), 21 GHTree_N (C++ function), 21 GHTree_Rt (C++ function), 20 GHTree_T (C++ function), 21 GHTree_Vt (C++ function), 20 GHTree_Xi (C++ function), 20 GHTree_Xt (C++ function), 20 I Info (C++ function), 20 Init (C++ function), 21 InterpolateEc (C++ function), 21 iterationHistory (C++ member), 21 L lm (C++ member), 23 M Marsupilami::Kernel::DRElement (C++ class), 22 Marsupilami::Kernel::DRRelax (C++ class), 20 Marsupilami::Kernel::Utility (C++ class), 24 N None (Foo.method method), 19 None (ValidClass class), 19 None (ValidClass.Foobar field), 19 None (ValidClass.Foobar property), 19 None (ValidClass.method method), 19 None (ValidClass.MethodArg method), 19 None (ValidClass.MethodArgs method), 19 None (ValidClass.MethodNested method), 19 None (ValidClass.MethodNoArgs method), 19 None (ValidEvent event), 20 None (ValidField field), 20 None (ValidInterface interface), 20 None (ValidNamespace namespace), 19, 20 None (ValidNamespace.Foobar<T,<string>> class), 20 None (ValidNamespace.Foobar<T,<T,<string>>> class), 20 None (ValidNamespace.Foobar<T,T> class), 20 None (ValidNamespace.Foobar<T> class), 20 None (ValidNamespace.Foobar<TFoo,TBar> class), 20 None (ValidNamespace.NestedClass class), 20 None (ValidNamespace.NestedClass.NestedClassEvent event), 20 None (ValidNamespace.NestedClass.NestedClassField field), 20 None (ValidNamespace.NestedClass.NestedClassOperator operator), 20 None (ValidNamespace.NestedClass.NestedClassProperty property), 20 27 Marsupilami Documentation, Release 0.x.0 None (ValidNamespace.NestedEvent event), 20 None (ValidNamespace.NestedField field), 20 None (ValidNamespace.NestedOperator operator), 20 None (ValidNamespace.NestedProperty property), 20 None (ValidOperator operator), 20 None (ValidProperty property), 20 None (ValidStructure structure), 19 numCurrentPicIterations (C++ member), 21 numElements (C++ member), 22 numIteration (C++ member), 21 numNodes (C++ member), 22 numPic (C++ member), 21 Q q (C++ member), 22 R Reset (C++ function), 21 Run (C++ function), 20 U Update_F (C++ function), 21 28 Index