Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

hyp.fem.mesh.h

00001 /*
00002 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
00003  Ephydryne Components.
00004  Ephydryne is a part of the Hyperion Project.
00005 ----------------------------------------------------------
00006  Copyright (c) 2001 Pierre Rebours.
00007 
00008  This library is free software; you can redistribute it and/or
00009  modify it under the terms of the GNU Lesser General Public
00010  License as published by the Free Software Foundation; either
00011  version 2.1 of the License, or (at your option) any later version.
00012 
00013  This library is distributed in the hope that it will be useful,
00014  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  
00017  See hyp.license.txt file for more information about the license.
00018  
00019  Web: http://lagrandeporte.multimania.com/hyperion
00020  Email: pierre_rebours@yahoo.com
00021 ----------------------------------------------------------
00022  CVS
00023  $Log$
00024  
00025  Creation 26/03/01 Pierre Rebours
00026 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
00027 */
00028 
00029 
00030 #ifndef _hyp_fem_mesh_h_
00031 #define _hyp_fem_mesh_h_
00032 
00033 #ifndef hypfem_INSIDE_INTERN
00034 #error Inclusion not allowed (include hyp.fem.intern.h instead)
00035 #endif
00036 
00037 
00047 class CFEOMesh :
00048 #ifdef hypfem_IDENTIFY_CONSTRUCTION_ON
00049 protected CIDClass,
00050 #endif
00051 public IFEOMesh,
00052 public hyp_ker::CUnknown
00053 {
00054 public:
00056         CFEOMesh(hyp_ker::IUnknown*);
00057         virtual ~CFEOMesh();
00058         hyp_DECLARE_IUNKNOWN
00059         virtual hyp_ker::com_result NondelegatingQueryInterface(const hyp_ker::hypIID&,void**);
00060         static hyp_ker::com_result CreateInstance(hyp_ker::IUnknown* ,hyp_ker::CUnknown** );
00061         hyp_ker::com_result Init(void); 
00062         void FinalRelease(void);
00064 
00068         virtual void SetDefaultMaterial(IFEOMaterial*);
00069         virtual const IFEOMaterial* GetDefaultMaterial() const;
00070         virtual void ConstructGlobalMatrix();
00071         virtual IMatrix* K() const;
00072         virtual void ConstructBoundaryMatrix();
00073         virtual void InverseBoundaryMatrix();
00074         virtual void ConstructVisibleMatrix();
00075         virtual void InitMasks();
00076 
00077         virtual void SetRenderMask(const t_mask_array&);
00078         virtual t_mask_array RenderMask();
00079         virtual t_real_array Displacement();
00080         virtual t_real_array GetGlobalDisplacement();
00081         
00082         virtual void SetRealTimeMask(const t_mask_array&);
00083         virtual t_mask_array RealTimeMask();
00084         virtual t_real_array RealTimeForce();
00085         virtual t_real_array GetGlobalRealTimeForce();
00086         virtual void SetGlobalRealTimeForce(const t_real_array&);
00087         virtual void ClearRealTimeForce();
00088 
00089         virtual void PreRender();
00090         virtual void Render();
00091         virtual void PostRender();
00092 
00093         virtual IGeometricBase* CreateElement(const t_label&,const t_label_enum&);
00094         virtual IContainerKey* GetContainerOfElements();
00095         virtual t_size GetNumberOfElements();
00096         virtual IGeometricBase* GetElement(const t_label&);
00097 
00098         virtual void SetForce(const t_label&,const t_real&,const t_real&,const t_real&);
00099         virtual void SetForce(const t_real&,const t_real&,const t_real&,bool,bool,bool,const t_real&,const t_real&,const t_real&);
00100         virtual void FixDOF(const t_real&,const t_real&,const t_real&,bool,bool,bool,bool,bool,bool);
00101 
00102         virtual void ClearAllData();
00103 
00104         virtual bool IsSideFixed(const t_label&,const t_size&);
00106         
00107 
00108 private:
00109         //pour l'assemblage
00110         t_label_enum GetElementLOCE(IFEOElement*);
00111         t_label GetNodeLOCE(IGeometricVertex*,t_size);
00112         void ShowLOCE(std::ostream&,const t_label_enum&,const std::string&);
00113 
00114         //le nombre de ddl, cad taille matrix
00115         t_size GetDOF(void);
00116         
00117         //le masque en function des ddl bloqués
00118         t_mask_array GetDOFMask(void);
00119         t_mask_array GetVisibleMask(void);
00120 
00121 private:
00122         //aggregation
00123         hyp_ker::IPtrUnknown m_spUnknownGeometricObject;
00124         inline IGeometricObject* GetGeometricObject(void) {
00125                 t_spGeometricObject spGeometricObject=m_spUnknownGeometricObject;
00126                 return spGeometricObject;
00127         }
00128         inline IGeometricBase* GetGeometricBase(void) {
00129                 t_spGeometricBase spGeometricBase=m_spUnknownGeometricObject;
00130                 return spGeometricBase;
00131         }
00132 
00133         //liste des éléments
00134         t_spContainerKey m_spElementsContKey;
00135 
00136         //material par defaut
00137         t_spFEOMaterial m_spDefaultMaterial;
00138 
00139         t_spMathMatrix m_spGlobalMatrix;
00140 
00141         class CMaskData{
00142         public:
00143                 CMaskData(int =0);
00144                 CMaskData(const CMaskData&);    //not implemented
00145 
00146                 void SetMask(const t_size&);
00147                 void SetMask(const t_mask_array&);
00148                 void MergeMask(const t_mask_array&);
00149                 void SetData(const t_real_array&);
00150                 
00151                 inline const t_mask_array& Mask(void) const { return m_Mask; }
00152                 inline const t_real_array& Data(void) const { return m_Data; }
00153                 
00154                 inline t_real& Data(t_size i) { hyp_ASSERT( i<m_Data.size() ); return m_Data[i]; }
00155                 inline bool& Mask(t_size i) { hyp_ASSERT( i<m_Mask.size() ); return m_Mask[i]; }
00156                 inline const t_real& Data(t_size i) const { hyp_ASSERT( i<m_Data.size() ); return m_Data[i]; }
00157                 inline const bool& Mask(t_size i) const { hyp_ASSERT( i<m_Mask.size() ); return m_Mask[i]; }
00158 
00159                 t_size GetMaskDim(void) const;
00160 
00161                 void SetGlobalData(const t_real_array&);
00162                 void GetGlobalData(t_real_array&) const;
00163                 void SetVector(IMatrix*) const;
00164                 void SetData(const IMatrix*);
00165                 void ClearData(t_real);
00166 
00167                 //donne le label absolu d'une force,d'un node(ex 0->0/1->0/2->0/3->1..)
00168                 t_size GetPos(const& t_label,const int&) const;
00169 
00170         private:
00171                 inline void CHECK_MATRIX_VALIDITY(const IMatrix* p_matrix) const {
00172                         hyp_ASSERT(p_matrix);
00173                         hyp_ASSERT( (p_matrix->GetNbColumn()==1) && 
00174                                 (p_matrix->GetNbRow()==m_Data.size()) );
00175                 }
00176                 static t_size ms_Dim;
00177                 t_mask_array m_Mask;
00178                 t_real_array m_Data;
00179         };      
00180 
00181         CMaskData m_RealTimeForce;
00182         CMaskData m_Displacement;
00183 };
00184 
00185 
00186 #endif

Top of Page
written by Pierre Rebours © 2000-2001. Terms of Use.