本文整理汇总了C++中fem::field::CFieldWorld::GetEA方法的典型用法代码示例。如果您正苦于以下问题:C++ CFieldWorld::GetEA方法的具体用法?C++ CFieldWorld::GetEA怎么用?C++ CFieldWorld::GetEA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fem::field::CFieldWorld
的用法示例。
在下文中一共展示了CFieldWorld::GetEA方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool View::CIndexArrayElem::Set_Hex
(unsigned int id_ea, unsigned int id_es,
const Fem::Field::CFieldWorld& world)
{
if( !world.IsIdEA(id_ea) ) return false;
const CElemAry& ea = world.GetEA(id_ea);
if( !ea.IsSegID(id_es) ) return false;
if( ea.ElemType() != HEX ) return false;
////////////////
itype = Fem::Field::HEX;
this->id_ea = id_ea;
this->id_es = id_es;
unsigned int id_es_add = 0;
CElemAry* pEA = ea.MakeBoundElemAry(id_es,id_es_add,aIndElem);
nElem = pEA->Size();
nnoel = 4;
assert( aIndElem.size() == nElem );
assert( pEA->IsSegID(id_es_add) );
const CElemAry::CElemSeg& es = pEA->GetSeg(id_es_add);
const unsigned int npofa = 4;
pIA_Elem = new unsigned int [nElem*npofa];
for(unsigned int iface=0;iface<nElem;iface++){
es.GetNodes(iface,pIA_Elem+iface*npofa);
}
delete pEA;
return true;
}
示例2: if
CIndexArrayElem::CIndexArrayElem(unsigned int id_ea, unsigned int id_es, const Fem::Field::CFieldWorld& world)
{
// std::cout << "CIndexArrayElem::CIndexArrayElem" << std::endl;
itype = ELEM_TYPE_NOT_SET;
is_selected = false;
this->id_ea=id_ea;
this->id_es=id_es;
color[0] = 0.8; color[1] = 0.8; color[2] = 0.8;
// color[0] = 1.0; color[1] = 1.0; color[2] = 1.0;
// color[0] = 0.8; color[1] = 0.2; color[2] = 0.2;
// color[0] = 0.2; color[1] = 0.8; color[2] = 0.2;
nElem = 0;
pIA_Elem = 0;
pColor = 0;
ilayer = 0;
////////////////
if( !world.IsIdEA(id_ea) ) return;
const CElemAry& ea = world.GetEA(id_ea);
if( ea.ElemType() == Fem::Field::POINT){ color[0]=0; color[1]=0; color[2]=0; }
else if( ea.ElemType() == Fem::Field::LINE ){ Set_Line(id_ea,id_es, world); color[0]=0; color[1]=0; color[2]=0; }
else if( ea.ElemType() == Fem::Field::TRI ){ Set_Tri( id_ea,id_es, world); }
else if( ea.ElemType() == Fem::Field::QUAD ){ Set_Quad(id_ea,id_es, world); }
else if( ea.ElemType() == Fem::Field::TET ){ Set_Tet( id_ea,id_es, world); }
else if( ea.ElemType() == Fem::Field::HEX ){ Set_Hex( id_ea,id_es, world); }
}
示例3:
/*
bool CEqnSystem_Solid2D::SetDomain_Field(unsigned int id_field_base, Fem::Field::CFieldWorld& world)
{
{ // ì¸óÕÉtÉBÅ[ÉãÉhÇÃç¿ïWêflì_ÉZÉOÉÅÉìÉgÇÃdofÇ™2ǩǫǧǩÉ`ÉFÉbÉNÇ∑ÇÈ
// unsigned int id_field_base = world.GetFieldBaseID();
assert( world.IsIdField(id_field_base) );
const CField& field_base = world.GetField(id_field_base);
assert( field_base.GetNDimCoord() == 2 );
}
m_IdFieldDisp = world.MakeField_FieldElemDim(id_field_base, 2,
VECTOR2,VALUE|VELOCITY|ACCELERATION,CORNER);
const CIDConvEAMshCad conv = world.GetIDConverter(id_field_base);
{
m_aEqn.clear();
const CField& field = world.GetField(m_IdFieldDisp);
const std::vector<unsigned int>& aIdEA = field.GetAryIdEA();
for(unsigned int iiea=0;iiea<aIdEA.size();iiea++){
const unsigned int id_ea = aIdEA[iiea];
assert( world.IsIdEA(id_ea) );
const CElemAry& ea = world.GetEA(id_ea);
if( ea.ElemType() != TRI && ea.ElemType() != QUAD ) continue;
m_aEqn.push_back( CEqn_Solid2D(id_ea,m_IdFieldDisp) );
}
}
this->ClearLinearSystemPreconditioner();
this->m_aIdFixField.clear();
return true;
}
*/
bool CEqnSystem_Solid2D::SetDomain_FieldEA(unsigned int id_field_base, unsigned int id_ea,
Fem::Field::CFieldWorld& world)
{
{ // ì¸óÕÉtÉBÅ[ÉãÉhÇÃç¿ïWêflì_ÉZÉOÉÅÉìÉgÇÃdofÇ™2ǩǫǧǩÉ`ÉFÉbÉNÇ∑ÇÈ
// unsigned int id_field_base = world.GetFieldBaseID();
assert( world.IsIdField(id_field_base) );
const CField& field_base = world.GetField(id_field_base);
assert( field_base.GetNDimCoord() == 2 );
}
m_IdFieldDisp = world.MakeField_FieldElemAry(id_field_base, id_ea,
VECTOR2,VALUE|VELOCITY|ACCELERATION,CORNER);
{
m_aEqn.clear();
const CField& field = world.GetField(m_IdFieldDisp);
const std::vector<unsigned int>& aIdEA = field.GetAryIdEA();
for(unsigned int iiea=0;iiea<aIdEA.size();iiea++){
const unsigned int id_ea = aIdEA[iiea];
assert( world.IsIdEA(id_ea) );
const CElemAry& ea = world.GetEA(id_ea);
if( ea.ElemType() != TRI && ea.ElemType() != QUAD ) continue;
m_aEqn.push_back( CEqn_Solid2D(id_ea,m_IdFieldDisp) );
}
}
this->ClearLinearSystemPreconditioner();
this->m_aIdFixField.clear();
return true;
}
示例4: assert
// add pattern to the diagonal
bool Ls::CLinearSystem_RigidField2::AddPattern_Field(const unsigned int id_field, const Fem::Field::CFieldWorld& world)
{
if( !world.IsIdField(id_field) ) return false;
const Fem::Field::CField& field = world.GetField(id_field);
unsigned int id_field_parent;
{
if( field.GetIDFieldParent() == 0 ){ id_field_parent = id_field; }
else{ id_field_parent = field.GetIDFieldParent(); }
}
const unsigned int nlen_value = field.GetNLenValue();
int ilss_add;
{ // Cornerブロックを作る
unsigned int id_na_val = field.GetNodeSegInNodeAry(Fem::Field::CORNER).id_na_va;
if( id_na_val != 0 ){
assert( world.IsIdNA(id_na_val) );
const Fem::Field::CNodeAry& na = world.GetNA(id_na_val);
assert( m_ls.GetNLinSysSeg() == this->m_aSegRF.size() );
ilss_add = m_ls.GetNLinSysSeg();
this->m_aSegRF.push_back( CLinSysSegRF(id_field_parent,Fem::Field::CORNER) );
int ires = m_ls.AddLinSysSeg( na.Size(), field.GetNLenValue() );
assert( ires == ilss_add );
}
else{ ilss_add = -1; }
}
////////////////////////////////
const std::vector<unsigned int> aIdEA = field.GetAryIdEA();
assert( aIdEA.size() > 0 );
for(unsigned int iiea=0;iiea<aIdEA.size();iiea++){
const unsigned int id_ea = aIdEA[iiea];
const Fem::Field::CElemAry& ea = world.GetEA(id_ea);
// CORNER節点について
if( field.GetIdElemSeg(id_ea,Fem::Field::CORNER,true,world) != 0 ){
assert( world.IsIdEA(id_ea) );
const unsigned int id_es_c = field.GetIdElemSeg(id_ea,Fem::Field::CORNER,true,world);
assert( ea.IsSegID(id_es_c) );
{
Com::CIndexedArray crs;
ea.MakePattern_FEM(id_es_c,crs);
m_ls.AddMat_Dia(ilss_add, crs ); // cc行列を作る
}
if( field.GetIdElemSeg(id_ea,Fem::Field::BUBBLE,true,world) != 0 ){ // CORNER-BUBBLE
assert(0);
}
if( field.GetIdElemSeg(id_ea,Fem::Field::EDGE,true,world) != 0 ){ // CONRER-EDGE
assert(0);
}
}
// EDGE節点について
if( field.GetIdElemSeg(id_ea,Fem::Field::EDGE,true,world) != 0 ){
assert(0);
}
// BUBBLE節点について
if( field.GetIdElemSeg(id_ea,Fem::Field::BUBBLE,true,world) != 0 ){
assert(0);
}
}
return true;
}
示例5: if
bool CEqn_Fluid3D::SetDomain(unsigned int id_base, Fem::Field::CFieldWorld& world)
{
bool is_mixed = false;
Field::ELEM_TYPE elem_type = (Field::ELEM_TYPE)0;
{
assert( world.IsIdField(id_base) );
const CField& field_base = world.GetField(id_base);
const std::vector<unsigned int>& aIdEA = field_base.GetAryIdEA();
for(unsigned int iiea=0; iiea<aIdEA.size(); iiea++) {
unsigned int id_ea = aIdEA[iiea];
CElemAry& ea = world.GetEA(id_ea);
if( ea.ElemType() == TET ) {
if( elem_type == 0 ) {
elem_type = TET;
}
else if( elem_type == HEX ) {
is_mixed = true;
break;
}
}
else if( ea.ElemType() == HEX ) {
if( elem_type == 0 ) {
elem_type = HEX;
}
else if( elem_type == TET ) {
is_mixed = true;
break;
}
}
}
}
if( is_mixed ) {
assert(0);
std::cout << "Not Implimented" << std::endl;
m_id_press = 0;
m_id_velo = 0;
return false;
}
if( elem_type == TET ) {
m_id_press = world.MakeField_FieldElemDim(id_base,3,
Fem::Field::SCALAR, VELOCITY|ACCELERATION,CORNER);
}
else if( elem_type == HEX ) {
m_id_press = world.MakeField_FieldElemDim(id_base,3,
Fem::Field::SCALAR, VELOCITY|ACCELERATION,BUBBLE);
}
m_id_velo = world.MakeField_FieldElemDim(id_base,3,
Fem::Field::VECTOR3,VELOCITY|ACCELERATION,CORNER);
this->ClearLinearSystemPreconditioner();
return true;
}
示例6: Update
bool CEdgeTextureColor::Update(const Fem::Field::CFieldWorld& world)
{
if( !world.IsIdField(this->id_field_velo) ){ return false; }
if( !world.IsIdField(this->id_part_field_velo) ){ return false; }
if( !world.IsIdEA(this->id_ea) ){ return false; }
const Fem::Field::CElemAry& ea = world.GetEA(id_ea);
assert( ea.ElemType() == Fem::Field::LINE );
if( nelem != ea.Size() ){
nelem = ea.Size();
if( m_aXYVeloElem != 0 ){ delete[] m_aXYVeloElem; }
if( m_aXYElem != 0 ){ delete[] m_aXYElem; }
m_aXYVeloElem = new double [nelem*4];
m_aXYElem = new double [nelem*4];
}
const Fem::Field::CField& fv = world.GetField(this->id_part_field_velo);
// const Fem::Field::CField::CNodeSegInNodeAry& nans = fv.GetNodeSegInNodeAry(Fem::Field::CORNER);
const Fem::Field::CNodeAry::CNodeSeg& ns_v = fv.GetNodeSeg(CORNER,true, world,VELOCITY);
const Fem::Field::CNodeAry::CNodeSeg& ns_c = fv.GetNodeSeg(CORNER,false,world,VELOCITY);
const Fem::Field::CElemAry::CElemSeg& es_v = fv.GetElemSeg(id_ea,CORNER,true, world);
const Fem::Field::CElemAry::CElemSeg& es_c = fv.GetElemSeg(id_ea,CORNER,false,world);
assert( es_v.Length() == 2 );
assert( es_c.Length() == 2 );
for(unsigned int ielem=0;ielem<nelem;ielem++)
{
unsigned int noes[2];
es_c.GetNodes(ielem,noes);
double co[2][2];
ns_c.GetValue(noes[0],co[0]);
ns_c.GetValue(noes[1],co[1]);
////////////////
es_v.GetNodes(ielem,noes);
double velo[2][2];
ns_v.GetValue(noes[0],velo[0]);
ns_v.GetValue(noes[1],velo[1]);
////////////////
m_aXYElem[ielem*4+0] = co[0][0];
m_aXYElem[ielem*4+1] = co[0][1];
m_aXYElem[ielem*4+2] = co[1][0];
m_aXYElem[ielem*4+3] = co[1][1];
////////////////
const double r = velo_scale;
m_aXYVeloElem[ielem*4+0] = co[0][0] + r*velo[0][0];
m_aXYVeloElem[ielem*4+1] = co[0][1] + r*velo[0][1];
m_aXYVeloElem[ielem*4+2] = co[1][0] + r*velo[1][0];
m_aXYVeloElem[ielem*4+3] = co[1][1] + r*velo[1][1];
}
return true;
}
示例7: if
//! set gradient value to the field
bool Fem::Field::SetFieldValue_Gradient
(unsigned int id_field_to, Fem::Field::CFieldWorld& world,
unsigned int id_field_from)
{
if( !world.IsIdField(id_field_from) ) return false;
Fem::Field::CField& field_from = world.GetField(id_field_from);
if( !world.IsIdField(id_field_to) ) return false;
Fem::Field::CField& field_to = world.GetField(id_field_to);
if( field_to.GetAryIdEA().size() != 1 ){
std::cout << "Error!-->Not Implimented" << std::endl;
getchar();
assert(0);
}
Fem::Field::INTERPOLATION_TYPE type_from, type_to;
{
const std::vector<unsigned int>& aIdEA_from = field_from.GetAryIdEA();
const std::vector<unsigned int>& aIdEA_to = field_to.GetAryIdEA();
if( aIdEA_from.size() != aIdEA_to.size() ) return false;
const unsigned int niea = aIdEA_from.size();
assert( niea == 1 );
if( aIdEA_from[0] != aIdEA_to[0] ) return false;
const unsigned int id_ea = aIdEA_from[0];
type_from = field_from.GetInterpolationType(id_ea,world);
type_to = field_to.GetInterpolationType(id_ea,world);
}
unsigned int nnoes, ndim;
if( type_from==HEX11 && type_to==HEX1001 ){
nnoes = 8; ndim = 3;
}
else if( type_from==TET11 && type_to==TET1001 ){
nnoes = 4; ndim = 3;
}
else if( type_from==TRI11 && type_to==TRI1001 ){
nnoes = 3; ndim = 2;
}
else{
std::cout << "NotImplimented!" << std::endl;
assert(0);
getchar();
}
unsigned int id_ea = field_to.GetAryIdEA()[0];
const CElemAry& ea = world.GetEA(id_ea);
const CElemAry::CElemSeg& es_c_co = field_from.GetElemSeg(id_ea,CORNER,false,world);
const CElemAry::CElemSeg& es_c_va = field_from.GetElemSeg(id_ea,CORNER,true, world);
const CElemAry::CElemSeg& es_b_va = field_to.GetElemSeg(id_ea,BUBBLE,true, world);
const Fem::Field::CField::CNodeSegInNodeAry& nsna_c = field_from.GetNodeSegInNodeAry(CORNER);
assert( world.IsIdNA(nsna_c.id_na_co) );
assert( world.IsIdNA(nsna_c.id_na_va) );
const CNodeAry& na_c_co = world.GetNA(nsna_c.id_na_co);
const CNodeAry::CNodeSeg& ns_c_co = na_c_co.GetSeg(nsna_c.id_ns_co);
const CNodeAry& na_c_va = world.GetNA(nsna_c.id_na_va);
const CNodeAry::CNodeSeg& ns_c_va = na_c_va.GetSeg(nsna_c.id_ns_va);
unsigned int id_na_b_va = field_to.GetNodeSegInNodeAry(BUBBLE).id_na_va;
unsigned int id_ns_b_va = field_to.GetNodeSegInNodeAry(BUBBLE).id_ns_va;
assert( world.IsIdNA(id_na_b_va) );
CNodeAry& na_b_va = world.GetNA(id_na_b_va);
CNodeAry::CNodeSeg& ns_b_va = na_b_va.GetSeg(id_ns_b_va);
double coord[16][3];
double value[16];
double grad[3];
// const unsigned int nnoes_c = es_c_co.GetSizeNoes();
unsigned int noes[64];
for(unsigned int ielem=0;ielem<ea.Size();ielem++){
{ // 座標(coord)と値(value)を作る
es_c_co.GetNodes(ielem,noes);
for(unsigned int inoes=0;inoes<nnoes;inoes++){
unsigned int ipoi0 = noes[inoes];
assert( ipoi0 < na_c_co.Size() );
ns_c_co.GetValue(ipoi0,coord[inoes]);
}
/* if( id_es_c_va == id_es_c_co ){
for(unsigned int inoes=0;inoes<nnoes;inoes++){
unsigned int ipoi0 = noes[inoes];
assert( ipoi0 < na_c_va.Size() );
na_c_va.GetValueFromNode(ipoi0,id_ns_c_va,0,val);
value[inoes] = val;
}
}
else{*/
es_c_va.GetNodes(ielem,noes);
for(unsigned int inoes=0;inoes<nnoes;inoes++){
unsigned int ipoi0 = noes[inoes];
assert( ipoi0 < na_c_va.Size() );
ns_c_va.GetValue(ipoi0,&value[inoes]);
}
// }
}
if( type_from == HEX11 ){
double dndx[8][3];
//.........这里部分代码省略.........
示例8: assert
// ÉXÉJÉâÅ[ÇÃâûóÕëäìñílÇí«â¡Ç∑ÇÈÅDǪÇÃǧÇøÉÇÅ[ÉhÇǬÇØÇÈ
// mode = 0 : É~Å[É[ÉX
// mode = 1 : ç≈ëÂâûóÕ
// äÙâΩäwìIÇ»îÒê¸å`ê´Ççló∂Ç∑ÇÈǩǫǧǩÇÕÅCEqnObjÇå©ÇƒåàÇflÇÈÇÊǧDžÇ∑ÇÈ
bool CEqnSystem_Solid2D::SetEquivStressValue(unsigned int id_field_str, Fem::Field::CFieldWorld& world)
{
if( !world.IsIdField(id_field_str) ) return false;
Fem::Field::CField& field_str = world.GetField(id_field_str);
if( field_str.GetFieldType() != SCALAR ) return false;
if( !world.IsIdField(m_IdFieldDisp) ) return false;
Fem::Field::CField& field_dis = world.GetField(m_IdFieldDisp);
const std::vector<unsigned int>& aIdEA_from = field_dis.GetAryIdEA();
const std::vector<unsigned int>& aIdEA_to = field_str.GetAryIdEA();
if( aIdEA_from.size() != aIdEA_to.size() ) return false;
const unsigned int niea = aIdEA_from.size();
for(unsigned int iiea=0;iiea<niea;iiea++)
{
Fem::Field::INTERPOLATION_TYPE type_from, type_to;
{
if( aIdEA_from[iiea] != aIdEA_to[iiea] ){
assert(0);
return false;
}
const unsigned int id_ea = aIdEA_from[iiea];
type_from = field_dis.GetInterpolationType(id_ea,world);
type_to = field_str.GetInterpolationType(id_ea,world);
}
unsigned int nnoes, ndim;
if( type_from==TRI11 && type_to==TRI1001 ){
nnoes = 3; ndim = 2;
}
else{
std::cout << "Error!-->Not Implimented!" << std::endl;
std::cout << type_from << " " << type_to << std::endl;
assert(0);
getchar();
}
unsigned int id_ea = aIdEA_to[iiea];
const CElemAry& ea = world.GetEA(id_ea);
const CElemAry::CElemSeg& es_c_co = field_dis.GetElemSeg(id_ea,CORNER,false,world);
const CElemAry::CElemSeg& es_c_va = field_dis.GetElemSeg(id_ea,CORNER,true, world);
const CElemAry::CElemSeg& es_b_va = field_str.GetElemSeg(id_ea,BUBBLE,true, world);
Fem::Field::CField::CNodeSegInNodeAry nans_c = field_dis.GetNodeSegInNodeAry(CORNER);
assert( world.IsIdNA(nans_c.id_na_co) );
assert( world.IsIdNA(nans_c.id_na_va) );
const CNodeAry& na_c_co = world.GetNA( nans_c.id_na_co);
const CNodeAry::CNodeSeg& ns_c_co = na_c_co.GetSeg( nans_c.id_ns_co);
const CNodeAry& na_c_va = world.GetNA( nans_c.id_na_va);
const CNodeAry::CNodeSeg& ns_c_va = na_c_va.GetSeg( nans_c.id_ns_va);
Fem::Field::CField::CNodeSegInNodeAry nans_b = field_str.GetNodeSegInNodeAry(BUBBLE);
unsigned int id_na_b_va = nans_b.id_na_va;
unsigned int id_ns_b_va = nans_b.id_ns_va;
assert( world.IsIdNA(id_na_b_va) );
CNodeAry& na_b_va = world.GetNA(id_na_b_va);
CNodeAry::CNodeSeg& ns_b_va = na_b_va.GetSeg(id_ns_b_va);
const unsigned int nnoes_c = es_c_co.Length();
assert( nnoes_c < 64 );
unsigned int noes[64];
const CEqn_Solid2D& eqn = this->GetEquation(id_ea);
for(unsigned int ielem=0;ielem<ea.Size();ielem++){
////////////////
double coord[16][3];
// ç¿ïW(coord)Ç∆íl(value)ÇçÏÇÈ
es_c_co.GetNodes(ielem,noes);
for(unsigned int inoes=0;inoes<nnoes;inoes++){
unsigned int ipoi0 = noes[inoes];
assert( ipoi0 < na_c_co.Size() );
ns_c_co.GetValue(ipoi0,coord[inoes]);
}
////////////////
double disp[16][3]; // êflì_ïœà
es_c_va.GetNodes(ielem,noes);
for(unsigned int inoes=0;inoes<nnoes;inoes++){
unsigned int ipoi0 = noes[inoes];
assert( ipoi0 < na_c_va.Size() );
for(unsigned int idim=0;idim<ndim;idim++){
ns_c_va.GetValue(ipoi0,disp[inoes]);
}
}
////////////////
double dudx[2][2]; // ïœå`å˘îz
if( type_from == TRI11 ){
double dldx[3][2];
double const_term[3];
TriDlDx(dldx,const_term, coord[0],coord[1],coord[2]);
for(unsigned int i=0;i<ndim*ndim;i++){ (&dudx[0][0])[i] = 0.0; }
for(unsigned int knoes=0;knoes<nnoes;knoes++){
dudx[0][0] += disp[knoes][0]*dldx[knoes][0];
dudx[0][1] += disp[knoes][0]*dldx[knoes][1];
dudx[1][0] += disp[knoes][1]*dldx[knoes][0];
dudx[1][1] += disp[knoes][1]*dldx[knoes][1];
//.........这里部分代码省略.........