====== XResult ====== **//Inherited from//** [[class::domain::nitem|NItem]], **//Inherited by//** NULL **//Friend class//** NULL **//Description//** XResult是一种封装了离散网格上的结果数据的结果基类,作为结果分量(XResultComponent)的容器使用,常用基础类型分为标量结果(包含一个基础分量如温度结果)、矢量结果(包含3个基础分量如位移结果)和张量结果(包含6个基础分量如应力、应变结果)。 结果数据对象属性包含所属分析步、子步、结果位置、基础自由度、源文件序号、参考坐标系ID、参考结果ID、结果层ID(对杆梁结果或板壳结果有效)以及主结果ID。 其中:\\ * 结果位置分为积分点上的数据、单元内节点上的数据和节点上的数据等类型,对于部分给定类型的结果(如应力),其结果数据往往会同时存在在不同的位置上,不同位置的结果数据大小并不一致,这个时候需要分别构建不同的结果对象;\\ * 基础自由度表征了该结果的原始结果分量个数,在某些情况下会通过原始分量计算得到衍生分量,比如从应力张量计算得到三个主应力、米塞斯应力等,原始分量和衍生分量共同构成结果的全部结果分量;\\ * 源文件序号记录了结果源文件的序号,在某些情况下结果是放在一个目录下的若干文件组成,不同结果可能来源于不同的结果文件,在快速浏览模式下只记录文件序号以及位置,只在需用要查看结果的时候才从指定文件指定位置导入;\\ * 参考结果ID用于指定本结果所参考的结果,表示本结果的数据要从参考结果的数据计算得出,比如单元内节点上的数据要从积分点上的数据外插计算得到, 节点上的数据要从单元内节点上的数据磨平得到;指定坐标系下的结果要从全局坐标系的结果变换得到;如果该值为0,表示它本身就是原始结果;\\ * 参考坐标系ID用于指定结果数据的参考坐标系,它一般要从全局坐标系下的结果计算得到,如该值为0,表示该结果就是全局坐标系下的结果;\\ * 结果层ID用于杆梁结果或板壳结果,杆梁结果或者板壳结果可能分为多个层次,该ID表示它属于哪个层次,如果该ID为0,表示它是实体结果;\\ * 主结果ID是该结果对象的父结果ID,当该结果是局部坐标系结果、板壳层结果、杆梁层结果时都必须从属一个主结果,如果该ID为0,表示它本身就是主结果,主结果时可以在结果子步中遍历访问,从属结果不能在结果子步中直接访问;\\ 区分结果对象的维度包含结果位置、局部坐标系、杆梁层次、板壳层次,不同的插值方法和磨平方法则须重新计算计算数据, **//Members//** * static ResultComponentManager * [[xresult#_compmgr|_compMgr]] * ResultHeader [[xresult#m_oheader|m_oHeader]] * const XResultSubstep * [[xresult#m_psubstep|m_pSubstep]] * vector [[xresult#m_pcomponents|m_pComponents]] * vector [[xresult#m_pshelllayers|m_pShellLayers]] * vector [[xresult#m_pbeamlayers|m_pBeamLayers]] * vector [[xresult#m_plocalcsys|m_pLocalCsys]] * XResult * [[xresult#m_pcurshelllayer|m_pCurShellLayer]] * XResult * [[xresult#m_pcurbeamlayer|m_pCurBeamLayer]] * int [[xresult#m_istatus|m_iStatus]] **//Public interface//** * [[xresult#xresult1|XResult]](ulong id, int type) * void [[xresult#clear|clear]]() * [[xresult#~xresult|~XResult]]() * XResult & [[xresult#addcomponent|addComponent]](TypeID compType) * XResult & operator [[xresult#<<|<<]] (TypeID compType) * XResultComponent * [[xresult#getcomponentbytype|getComponentByType]](TypeID t) * XResultComponent * [[xresult#getcomponent|getComponent]](const char * compName) * const char * [[xresult#getlabel|getLabel]](int component) * int [[xresult#getdof|getDoF]]() const * TypeID [[xresult#getlocation|getLocation]]() const * void [[xresult#setlocation|setLocation]](TypeID loc) * ulong [[xresult#getlayerid|getLayerID]]() const * void [[xresult#setlayerid|setLayerID]](int lid) * ulong [[xresult#getcoordsysid|getCoordSysID]]() * void [[xresult#setcoordsysid|setCoordSysID]](ulong cid) * void [[xresult#setflag|setFlag]](ResultStatus r, bool b) * bool [[xresult#isvirtual|isVirtual]]() const * void [[xresult#setreference|setReference]](ulong id) * ulong [[xresult#getreference|getReference]]() const * virtual bool [[xresult#buildderivedcomponent|buildDerivedComponent]](TypeID t) * ErrorCode [[xresult#read|read]](H5IO* io, H5Obj * grp) * void [[xresult#write|write]](H5IO * io, H5Obj * grp) * ResultHeader & [[xresult#getheader|getHeader]]() * const ResultHeader & [[xresult#getheader|getHeader]]() const * int [[xresult#getcomponentindex|getComponentIndex]](TypeID t) const * int [[xresult#getcomponentindexbyname|getComponentIndexByName]](const char * label) const * void [[xresult#setstep|setStep]](int iMainID, int iSubID) * float * [[xresult#getcomponentdata|getComponentData]](int component) * const float * [[xresult#getcomponentdata|getComponentData]](int component) const * float [[xresult#getnoderesultvalue|getNodeResultValue]](const XNode * n, int component) const * float [[xresult#getelementresultvalue|getElementResultValue]](const XElement * n, int component) const * float [[xresult#getelementnoderesultvalue|getElementNodeResultValue]](const XElement * n, int nodeIndex, const int * elemNodeIndexArray, int component) const * int [[xresult#getcomponentcount|getComponentCount]]() const * void [[xresult#addbeamlayer|addBeamLayer]](XResult * rlt) * void [[xresult#addshelllayer|addShellLayer]](XResult * rlt) * void [[xresult#addlocalcsresult|addLocalCSResult]](XResult * rlt) * void [[xresult#allocdata|allocData]](int component, int count) * bool [[xresult#loaddata|loadData]](H5IO * io, H5Obj * grp,int component) * void [[xresult#dumpdata|dumpData]](H5IO * io, H5Obj * grp,int component) * bool [[xresult#isidentical|isIdentical]](XResult * rlt) const * bool [[xresult#isidentical|isIdentical]](int type, const char * name, int loc) const * bool [[xresult#ischief|isChief]]() const * bool [[xresult#isimported|isImported]]() const * bool [[xresult#isloaded|isLoaded]](int comp) const * XResult* [[xresult#getlcsresult|getLCSResult]](ulong cid) * int [[xresult#getlcsresultcount|getLCSResultCount]]() const * XResult* [[xresult#getlcsresultbyindex|getLCSResultByIndex]](int idx) * XResult* [[xresult#getbeamlayer|getBeamLayer]](ulong beamLayerID) * const XResult * [[xresult#getbeamlayer|getBeamLayer]](ulong beamLayerID) const * int [[xresult#getbeamlayercount|getBeamLayerCount]]() const * XResult* [[xresult#getbeamlayerbyindex|getBeamLayerByIndex]](int idx) * XResult* [[xresult#getshelllayerbyindex|getShellLayerByIndex]](int idx) * XResult* [[xresult#getshelllayer|getShellLayer]](ulong shellLayerID) * const XResult * [[xresult#getshelllayer|getShellLayer]](ulong shellLayerID) const * int [[xresult#getshelllayercount|getShellLayerCount]]() const * XResult * [[xresult#getlayer|getLayer]](ulong layerID) * XResult* [[xresult#getcurbeamlayer|getCurBeamLayer]]() const * XResult* [[xresult#getcurshelllayer|getCurShellLayer]]() const * void [[xresult#setcurrentbeamlayer|setCurrentBeamLayer]](ulong beamLayerID) * void [[xresult#setcurrentshelllayer|setCurrentShellLayer]](ulong shellLayerID) * const XResultComponent * [[xresult#getcomponent|getComponent]](int cp) const * XResultComponent * [[xresult#getcomponent|getComponent]](int cp) * void [[xresult#updatecomponentextrem|updateComponentExtrem]](int cp, XModel * mdl, ResultIndexMap * rimap) * const XResultSubstep * [[xresult#getsubstep|getSubstep]]() const * void [[xresult#setsubstep|setSubstep]](const XResultSubstep * ss) ---- {{anchor:_compmgr}} **static ResultComponentManager * _compMgr** 结果分量管理器 {{anchor:m_oheader}} **ResultHeader m_oHeader** 结果属性块 {{anchor:m_psubstep}} **const XResultSubstep * m_pSubstep** 结果所属子步 {{anchor:m_pcomponents}} **vector m_pComponents** 结果分量数组 {{anchor:m_pshelllayers}} **vector m_pShellLayers** 板壳结果层数组 {{anchor:m_pbeamlayers}} **vector m_pBeamLayers** 杆梁结果层数组 {{anchor:m_plocalcsys}} **vector m_pLocalCsys** 局部坐标系结果数组 {{anchor:m_pcurshelllayer}} **XResult * m_pCurShellLayer** 当前板壳结果层 {{anchor:m_pcurbeamlayer}} **XResult * m_pCurBeamLayer** 当前杆梁结果层 ---- {{anchor:xresult1}} **XResult(ulong id, int type)** *function: 构造函数 *parameters: - [i]ulong id: 身份ID - [i] int type: 结果类型 *return value: 无 {{anchor:clear}} **void clear()** *function: 清空结果分量 *parameters: NULL *return value: 无 {{anchor:~xresult}} **~XResult()** *function: 析构函数 *parameters: NULL *return value: 无 {{anchor:addcomponent}} **XResult & addComponent(TypeID compType)** *function: 添加结果分量 *parameters: - [i]TypeID compType: 结果分量类型 *return value: 返回结果对象的引用 {{anchor:<<}} **XResult & operator << (TypeID compType)** *function: 与addComponent等价的另外一种便捷调用 *parameters: - [i]TypeID compType: 结果分量类型 *return value: 返回结果对象的引用 {{anchor:getcomponentbytype}} **XResultComponent * getComponentByType(TypeID t)** *function: 获取指定类型的结果分量 *parameters: - [i]TypeID t: 结果分量类型 *return value: 结果分量指针 {{anchor:getcomponent}} **XResultComponent * getComponent(const char * compName)** *function: 获取给定名字的结果分量 *parameters: - [i]const char * compName: 结果分量名字 *return value: 结果分量指针 {{anchor:getlabel}} **const char * getLabel(int component)** *function: 获取结果分量的标签 *parameters: - [i]int component: 结果分量序号 *return value: 结果分量的标签字符串 {{anchor:getdof}} **int getDoF() const** *function: 获取结果对象的基础自由度 *parameters: NULL *return value: 无 {{anchor:getlocation}} **TypeID getLocation() const** *function: 获取结果对象的位置 *parameters: NULL *return value: 结果对象的位置 {{anchor:setlocation}} **void setLocation(TypeID loc)** *function: 设置结果对象的位置 *parameters: - [i]TypeID loc: 结果位置 *return value: 无 {{anchor:getlayerid}} **ulong getLayerID() const** *function: 获取所属结果层ID *parameters: NULL *return value: 所属结果层ID {{anchor:setlayerid}} **void setLayerID(int lid)** *function: 设置所属结果层ID *parameters: - [i]int lid: 结果层ID *return value: 无 {{anchor:getcoordsysid}} **ulong getCoordSysID()** *function: 获取局部坐标系ID *parameters: NULL *return value: 局部坐标系ID {{anchor:setcoordsysid}} **void setCoordSysID(ulong cid)** *function: 设置局部坐标系ID *parameters: - [i]ulong cid: 局部坐标系ID *return value: 无 {{anchor:setflag}} **void setFlag(ResultStatus r, bool b)** *function: 设置结果对象的状态 *parameters: - [i] ResultStatus r: 结果对象的状态(分为正常结果、索引结果、虚结果类型) - [i] bool b: 激活或者失效 *return value: 无 {{anchor:isvirtual}} **bool isVirtual() const** *function: 是否为虚结果 *parameters: NULL *return value: 是虚结果返回true,否则返回false {{anchor:setreference}} **void setReference(ulong id)** *function: 设置参考结果ID *parameters: - [i]ulong id: 参考结果ID *return value: 无 {{anchor:getreference}} **ulong getReference() const** *function: 获取参考结果ID *parameters: NULL *return value: 参考结果ID {{anchor:buildderivedcomponent}} **virtual bool buildDerivedComponent(TypeID t)** *function: 构建衍生结果 *parameters: - [i]TypeID t: 衍生结果分量类型 *return value: 无 {{anchor:read}} **ErrorCode read(H5IO* io, H5Obj * grp)** *function: 从HDF5文件中读取结果数据 *parameters: - [i]H5IO* io: HDF5文件句柄 - [i] H5Obj * grp: 对应的HDF5节点 *return value: 成功读取则返回Error_None,否则返回相应错误码 {{anchor:write}} **void write(H5IO * io, H5Obj * grp)** *function: 将结果数据写入到HDF5文件中 *parameters: - [i]H5IO * io: HDF5文件句柄 - [i] H5Obj * grp: 对应的HDF5节点 *return value: 无 {{anchor:getheader}} **ResultHeader & getHeader()** *function: 结果属性 *parameters: NULL *return value: 结果属性的引用 {{anchor:getheader}} **const ResultHeader & getHeader() const** *function: 结果属性 *parameters: NULL *return value: 结果属性的引用 {{anchor:getcomponentindex}} **int getComponentIndex(TypeID t) const** *function: 获取结果分量的索引号 *parameters: - [i]TypeID t: 结果分量类型 *return value: 结果分量的索引号 {{anchor:getcomponentindexbyname}} **int getComponentIndexByName(const char * label) const** *function: 获取结果分量的索引号 *parameters: - [i]const char * label: 结果分量的名字 *return value: 结果分量的索引号 {{anchor:setstep}} **void setStep(int iMainID, int iSubID)** *function: 设置结果所属的步、子步 *parameters: - [i]int iMainID: 结果步序号 - [i] int iSubID: 结果子步序号 *return value: 无 {{anchor:getcomponentdata}} **float * getComponentData(int component)** *function: 获取结果分量的数据首地址 *parameters: - [i]int component: 结果分量索引号 *return value: 结果分量的数据地址 {{anchor:getcomponentdata}} **const float * getComponentData(int component) const** *function: 获取结果分量的数据首地址 *parameters: - [i]int component: 结果分量索引号 *return value: 结果分量的数据地址 {{anchor:getnoderesultvalue}} **float getNodeResultValue(const XNode * n, int component) const** *function: 获取指定分量在节点上的结果 *parameters: - [i]const XNode * n: 节点指针 - [i] int component: 分量索引号 *return value: 指定分量在节点上的结果数据 {{anchor:getelementresultvalue}} **float getElementResultValue(const XElement * n, int component) const** *function: 获取指定分量在单元上的结果 *parameters: - [i]const XElement * n: 单元指针 - [i] int component: 分量索引号 *return value: 指定分量在单元上的结果 {{anchor:getelementnoderesultvalue}} **float getElementNodeResultValue(const XElement * n, int nodeIndex, const int * elemNodeIndexArray, int component) const** *function: 获取指定分量在指定单元节点上的结果 *parameters: - [i]const XElement * n: 单元指针 - [i] int nodeIndex: 单元节点序号 - [i] const int * elemNodeIndexArray: 单元节点序号索引数组 - [i] int component: 分量索引号 *return value: 指定分量在指定单元节点上的结果 {{anchor:getcomponentcount}} **int getComponentCount() const** *function: 获取分量的个数 *parameters: NULL *return value: 分量的个数 {{anchor:addbeamlayer}} **void addBeamLayer(XResult * rlt)** *function: 添加杆梁结果层 *parameters: - [i]XResult * rlt: 杆梁结果层 *return value: 无 {{anchor:addshelllayer}} **void addShellLayer(XResult * rlt)** *function: 添加板壳结果层 *parameters: - [i]XResult * rlt: 板壳结果层 *return value: 无 {{anchor:addlocalcsresult}} **void addLocalCSResult(XResult * rlt)** *function: 添加局部坐标系下的结果数据对象 *parameters: - [i]XResult * rlt: 局部坐标系下的结果数据对象 *return value: 无 {{anchor:allocdata}} **void allocData(int component, int count)** *function: 为指定分量分配内存空间 *parameters: - [i]int component: 分量索引号 - [i] int count: *return value: {{anchor:loaddata}} **bool loadData(H5IO * io, H5Obj * grp,int component)** *function: 从HDF5文件中载入指定分量的数据 *parameters: - [i]H5IO * io: HDF5文件句柄 - [i] H5Obj * grp: 对应的HDF5节点 - [i]int component: 分量索引号 *return value: 成功载入返回true,否则返回false {{anchor:dumpdata}} **void dumpData(H5IO * io, H5Obj * grp,int component)** *function: 将指定分量的结果数据倒入到HDF5文件中 *parameters: - [i]H5IO * io: HDF5文件句柄 - [i] H5Obj * grp: 对应的HDF5节点 - [i]int component: 分量索引号 *return value: 无 {{anchor:isidentical}} **bool isIdentical(XResult * rlt) const** *function: 判断两个结果是否属于同一类型 *parameters: - [i]XResult * rlt: 被比较的结果对象指针 *return value: 若结果类型一致返回true,否则返回false {{anchor:isidentical}} **bool isIdentical(int type, const char * name, int loc) const ** *function: 判断结果对象匹配类型、标签与位置 *parameters: - [i]int type: 结果类型 - [i] const char * name: 结果标签字符串 - [i] int loc: 结果位置 *return value: 若结果类型一致返回true,否则返回false {{anchor:ischief}} **bool isChief() const** *function: 是否为主结果 *parameters: NULL *return value: 如为主结果返回true,否则返回false {{anchor:isimported}} **bool isImported() const** *function: 判断结果是否已导入 *parameters: NULL *return value: 如已导入返回true,否则返回false {{anchor:isloaded}} **bool isLoaded(int comp) const** *function: 判断结果数据是否已载入内存 *parameters: - [i]int comp: 分量索引号 *return value: 结果数据已载入内存返回true,否则返回false {{anchor:getlcsresult}} **XResult* getLCSResult(ulong cid)** *function: 获取指定坐标系下的结果,如cid为0返回本身 *parameters: - [i]ulong cid: 指定坐标系ID *return value: 指定坐标系下的结果,如cid为0返回本身 {{anchor:getlcsresultcount}} **int getLCSResultCount() const** *function: 获取局部坐标系的结果对象个数 *parameters: NULL *return value: 局部坐标系的结果对象个数 {{anchor:getlcsresultbyindex}} **XResult* getLCSResultByIndex(int idx)** *function: 获取指定序号的局部坐标系结果 *parameters: - [i]int idx: 局部坐标系结果序号 *return value: 指定序号的局部坐标系结果 {{anchor:getbeamlayer}} **XResult* getBeamLayer(ulong beamLayerID)** *function: 获取杆梁层结果 *parameters: - [i]ulong beamLayerID: 杆梁层ID *return value: 杆梁层结果指针 {{anchor:getbeamlayer}} **const XResult * getBeamLayer(ulong beamLayerID) const** *function: 获取杆梁层结果 *parameters: - [i]ulong beamLayerID: 杆梁层ID *return value: 杆梁层结果指针 {{anchor:getbeamlayercount}} **int getBeamLayerCount() const** *function: 获取杆梁层结果个数 *parameters: NULL *return value: 杆梁层结果个数 {{anchor:getbeamlayerbyindex}} **XResult* getBeamLayerByIndex(int idx)** *function: 通过序号获取杆梁层结果 *parameters: - [i]int idx: 杆梁层序号 *return value: 杆梁层结果指针 {{anchor:getshelllayerbyindex}} **XResult* getShellLayerByIndex(int idx)** *function: 通过序号获取板壳层结果 *parameters: - [i]int idx: 板壳层序号 *return value: 板壳层结果指针 {{anchor:getshelllayer}} **XResult* getShellLayer(ulong shellLayerID)** *function: 获取板壳层结果 *parameters: - [i]ulong shellLayerID: 板壳层结果ID *return value: 板壳层结果指针 {{anchor:getshelllayer}} **const XResult * getShellLayer(ulong shellLayerID) const** *function: 获取板壳层结果 *parameters: - [i]ulong shellLayerID: 板壳层结果ID *return value: 板壳层结果指针 {{anchor:getshelllayercount}} **int getShellLayerCount() const** *function: 获取板壳层结果个数 *parameters: NULL *return value: 板壳层结果个数 {{anchor:getlayer}} **XResult * getLayer(ulong layerID)** *function: 获取指定ID的结果层 *parameters: - [i]ulong layerID: 结果层ID *return value: 指定ID的结果层(可能是杆梁结果,也可能是板壳结果) {{anchor:getcurbeamlayer}} **XResult* getCurBeamLayer() const** *function: 获取当前杆梁结果层 *parameters: NULL *return value: 当前杆梁结果层 {{anchor:getcurshelllayer}} **XResult* getCurShellLayer() const** *function: 获取当前板壳结果层 *parameters: NULL *return value: 当前板壳结果层 {{anchor:setcurrentbeamlayer}} **void setCurrentBeamLayer(ulong beamLayerID)** *function: 设置当前杆梁结果层ID *parameters: - [i]ulong beamLayerID: 杆梁结果层ID *return value: 无 {{anchor:setcurrentshelllayer}} **void setCurrentShellLayer(ulong shellLayerID)** *function: 设置当前板壳结果层ID *parameters: - [i]ulong shellLayerID: 板壳结果层ID *return value: 无 {{anchor:getcomponent}} **const XResultComponent * getComponent(int cp) const** *function: 获取指定结果分量 *parameters: - [i]int cp: 分量索引号 *return value: 指定结果分量指针 {{anchor:getcomponent}} **XResultComponent * getComponent(int cp)** *function: 获取指定结果分量 *parameters: - [i]int cp: 分量索引号 *return value: 指定结果分量指针 {{anchor:updatecomponentextrem}} **void updateComponentExtrem(int cp, XModel * mdl, ResultIndexMap * rimap)** *function: *parameters: - [i]int cp: 更新指定分量的极值 - [i] XModel * mdl: 网格模型 - [i] ResultIndexMap * rimap: 结果索引映射表 *return value: 无 {{anchor:getsubstep}} **const XResultSubstep * getSubstep() const** *function: 获取对象所在的结果子步 *parameters: NULL *return value: 对象所在的结果子步 {{anchor:setsubstep}} **void setSubstep(const XResultSubstep * ss)** *function: 设置结果子步 *parameters: - [i]const XResultSubstep * ss: 结果子步指针 *return value: 无