예제 #1
0
bool CEqnSystem_Fluid2D::UpdateDomain_FieldElemAry(unsigned int id_base,unsigned int id_ea, Fem::Field::CFieldWorld& world)
{
    m_id_press = world.MakeField_FieldElemAry(id_base,id_ea,
                 Fem::Field::SCALAR, VELOCITY|ACCELERATION,CORNER);

    if( m_IsntInterpolationBubble) {
        std::cout << "not bubble intp" << std::endl;
        m_id_velo  = world.MakeField_FieldElemAry(id_base,id_ea,
                     Fem::Field::VECTOR2,VELOCITY|ACCELERATION,CORNER);
        m_IsntCombine = false;
    }
    else {
        std::cout << "bubble intp" << std::endl;
        m_id_velo  = world.MakeField_FieldElemAry(id_base,id_ea,
                     Fem::Field::VECTOR2,VELOCITY|ACCELERATION,CORNER|BUBBLE);
        m_IsntCombine = true;
    }

    {   // 同じ要素配列IDを持つ方程式があったら,それを使う.なければ新規に追加
        std::vector<CEqn_Fluid2D> aEqn_old = m_aEqn;
        m_aEqn.clear();
        const CField& field = world.GetField(m_id_velo);
        const std::vector<unsigned int>& aIdEA = field.GetAryIdEA();
        for(unsigned int iiea=0; iiea<aIdEA.size(); iiea++) {
            const unsigned int id_ea = aIdEA[iiea];
            unsigned int ieqn0=0;
            for(; ieqn0<aEqn_old.size(); ieqn0++) {
                if( aEqn_old[ieqn0].GetIdEA() == id_ea ) {
                    const unsigned int ieqn1 = m_aEqn.size();
                    m_aEqn.push_back( aEqn_old[ieqn0] );
                    m_aEqn[ieqn1].SetIdFieldVelocity(m_id_velo);
                    m_aEqn[ieqn1].SetIdFieldPressure(m_id_press);
                    break;
                }
            }
            if( ieqn0 != aEqn_old.size() ) {
                continue;
            }
            CEqn_Fluid2D eqn1(id_ea,m_id_velo,m_id_press);
            eqn1.SetRho(m_rho_back);
            eqn1.SetMyu(m_myu_back);
            if( this->m_is_stokes_back ) {
                eqn1.SetStokes();
            }
            else {
                eqn1.SetNavierStokes();
            }
            m_aEqn.push_back( eqn1 );
        }
    }

    this->ClearLinearSystemPreconditioner();
    return true;
}
예제 #2
0
/*
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;
}
예제 #3
0
bool CEqnSystem_Scalar2D::SetDomain_FieldElemAry(unsigned int id_base, unsigned int id_ea, Fem::Field::CFieldWorld& world)
{
	m_IdFieldVal = world.MakeField_FieldElemAry(id_base,id_ea,SCALAR,VELOCITY|VALUE,CORNER);
	{
		m_aEqn.clear();
		const CField& field = world.GetField(m_IdFieldVal);
		const std::vector<unsigned int>& aIdEA = field.GetAryIdEA();
		for(unsigned int iiea=0;iiea<aIdEA.size();iiea++){
			const unsigned int id_ea = aIdEA[iiea];
			m_aEqn.push_back( CEqn_Scalar2D(id_ea,m_IdFieldVal) );
		}
	}
	this->ClearLinearSystemPreconditioner();
	this->m_aIdFixField.clear();
	return true;
}