• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ patch函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中patch函数的典型用法代码示例。如果您正苦于以下问题:C++ patch函数的具体用法?C++ patch怎么用?C++ patch使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了patch函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: UpdateStatistic

void DynamicGroupUpdateCallback::operator()( osg::Node* node, osg::NodeVisitor* nv )
{
	//сформировать массив данных о видимых патчах
	m_VisiblePatchArray.Update();

	//обновить коэффициенты из файла
//	UpdateKof();

	//обновить статистику
	UpdateStatistic();

	osg::ref_ptr< osg::Group > group = dynamic_cast< osg::Group* >( node );

	if ( group )
	{
		//вернуть ссылку на массив видимых патчей
		const std::vector< dataPatch > &data_vis = m_VisiblePatchArray.GetVisibleArray();

		if ( !data_vis.empty() )
		{
			//FindMax();
			//std::cout << data_vis.size() << "-" << FindMax() << " ";

			//очистить всех детей
			group->removeChildren( 0 , group->getNumChildren() );

			//перебрать все видимые узлы
			for( int i = 0 ; i < data_vis.size() ; ++i )
			{
				//сформировать геометрию
				//GeometryPatch patch( data_vis[ i ].m_iX , 
				//	data_vis[ i ].m_iY , 65 , 
				//	data_vis[ i ].m_iSize );

				osg::ref_ptr< osg::Geode > geode = new osg::Geode;

				if ( data_vis[ i ].m_iSize == 1024 )
				{
					GeometryTexturePatch1 patch( data_vis[ i ].m_iX , 
						data_vis[ i ].m_iY , 66 , 
						data_vis[ i ].m_iSize , m_ImageIndex.get()
						, 2 , -64 );	//1 -32

					geode->addDrawable( patch.GetGeometry().get() );
				}
				else
					if ( data_vis[ i ].m_iSize == 512 )
					{
						GeometryTexturePatch patch( data_vis[ i ].m_iX , 
							data_vis[ i ].m_iY , 65 , 
							data_vis[ i ].m_iSize , m_ImageIndex.get()
							, 1 , 30 );

						geode->addDrawable( patch.GetGeometry().get() );
					}
					else
						if ( data_vis[ i ].m_iSize == 2048 )
						{
							GeometryTexturePatch2 patch( data_vis[ i ].m_iX , 
								data_vis[ i ].m_iY , 68 , 
								data_vis[ i ].m_iSize , m_ImageIndex.get()
								, 2 , -64 );

							geode->addDrawable( patch.GetGeometry().get() );
						}
						else
							if ( data_vis[ i ].m_iSize == 4096 )
							{
								GeometryTexturePatch4 patch( data_vis[ i ].m_iX , 
									data_vis[ i ].m_iY , 64 + 8, 
									data_vis[ i ].m_iSize , m_ImageIndex.get()
									, 2 , -128 );

								geode->addDrawable( patch.GetGeometry().get() );
							}
							else
								if ( data_vis[ i ].m_iSize == 8192 )
								{
									GeometryTexturePatch8 patch( data_vis[ i ].m_iX , 
										data_vis[ i ].m_iY , 64 + 16, 
										data_vis[ i ].m_iSize , m_ImageIndex.get()
										, 2 , -128 );

									geode->addDrawable( patch.GetGeometry().get() );
								}
								else
									if ( data_vis[ i ].m_iSize == 16384 )
									{
										GeometryTexturePatch16 patch( data_vis[ i ].m_iX , 
											data_vis[ i ].m_iY , 64 + 32, 
											data_vis[ i ].m_iSize , m_ImageIndex.get()
											, 2 , -128 );

										geode->addDrawable( patch.GetGeometry().get() );
									}
									else
										if ( data_vis[ i ].m_iSize == 32768 )
										{
											GeometryTexturePatch32 patch( data_vis[ i ].m_iX , 
												data_vis[ i ].m_iY , 64 + 64, 
//.........这里部分代码省略.........
开发者ID:wangfeilong321,项目名称:osgtraining,代码行数:101,代码来源:DynamicGroupUpdateCallback.cpp


示例2: patch

ofxPDSPStereoFader& ofxPDSPStereoFader::operator=(const ofxPDSPStereoFader & other){
    patch();
    return *this;
}
开发者ID:npisanti,项目名称:ofxPDSP,代码行数:4,代码来源:ofxPDSPStereoFader.cpp


示例3: ofxPDSPStereoFader

ofxPDSPStereoFader::ofxPDSPStereoFader(const ofxPDSPStereoFader & other) : ofxPDSPStereoFader(){
    patch();
}
开发者ID:npisanti,项目名称:ofxPDSP,代码行数:3,代码来源:ofxPDSPStereoFader.cpp


示例4: patch

void Foam::inclinedFilmNusseltInletVelocityFvPatchVectorField::updateCoeffs()
{
    if (updated())
    {
        return;
    }

    const label patchi = patch().index();

    // retrieve the film region from the database

    const regionModels::regionModel& region =
        db().time().lookupObject<regionModels::regionModel>
        (
            "surfaceFilmProperties"
        );

    const regionModels::surfaceFilmModels::kinematicSingleLayer& film =
        dynamic_cast
        <
            const regionModels::surfaceFilmModels::kinematicSingleLayer&
        >(region);

    // calculate the vector tangential to the patch
    // note: normal pointing into the domain
    const vectorField n(-patch().nf());

    // TODO: currently re-evaluating the entire gTan field to return this patch
    const scalarField gTan(film.gTan()().boundaryField()[patchi] & n);

    if (patch().size() && (max(mag(gTan)) < SMALL))
    {
        WarningInFunction
            << "is designed to operate on patches inclined with respect to "
            << "gravity"
            << endl;
    }

    const volVectorField& nHat = film.nHat();

    const vectorField nHatp(nHat.boundaryField()[patchi].patchInternalField());

    vectorField nTan(nHatp ^ n);
    nTan /= mag(nTan) + ROOTVSMALL;

    // calculate distance in patch tangential direction

    const vectorField& Cf = patch().Cf();
    scalarField d(nTan & Cf);

    // calculate the wavy film height

    const scalar t = db().time().timeOutputValue();

    const scalar GMean = GammaMean_->value(t);
    const scalar a = a_->value(t);
    const scalar omega = omega_->value(t);

    const scalarField G(GMean + a*sin(omega*constant::mathematical::twoPi*d));

    const volScalarField& mu = film.mu();
    const scalarField mup(mu.boundaryField()[patchi].patchInternalField());

    const volScalarField& rho = film.rho();
    const scalarField rhop(rho.boundaryField()[patchi].patchInternalField());

    const scalarField Re(max(G, scalar(0.0))/mup);

    operator==(n*pow(gTan*mup/(3.0*rhop), 0.333)*pow(Re, 0.666));

    fixedValueFvPatchVectorField::updateCoeffs();
}
开发者ID:EricAlex,项目名称:OpenFOAM-dev,代码行数:72,代码来源:inclinedFilmNusseltInletVelocityFvPatchVectorField.C


示例5: swit2

void
swit2(C1 *q, int nc, int32 def, Node *n)
{
	C1 *r;
	int i;
	int32 v;
	Prog *sp;

	if(nc >= 3) {
		i = (q+nc-1)->val - (q+0)->val;
		if(i > 0 && i < nc*2)
			goto direct;
	}
	if(nc < 5) {
		for(i=0; i<nc; i++) {
			if(debug['W'])
				print("case = %.8ux\n", q->val);
			gopcode(OEQ, nodconst(q->val), n, Z);
			patch(p, q->label);
			q++;
		}
		gbranch(OGOTO);
		patch(p, def);
		return;
	}

	i = nc / 2;
	r = q+i;
	if(debug['W'])
		print("case > %.8ux\n", r->val);
	gopcode(OGT, nodconst(r->val), n, Z);
	sp = p;
	gopcode(OEQ, nodconst(r->val), n, Z);	/* just gen the B.EQ */
	patch(p, r->label);
	swit2(q, i, def, n);

	if(debug['W'])
		print("case < %.8ux\n", r->val);
	patch(sp, pc);
	swit2(r+1, nc-i-1, def, n);
	return;

direct:
	v = q->val;
	if(v != 0)
		gopcode(OSUB, nodconst(v), Z, n);
	gopcode(OCASE, nodconst((q+nc-1)->val - v), n, Z);
	patch(p, def);
	for(i=0; i<nc; i++) {
		if(debug['W'])
			print("case = %.8ux\n", q->val);
		while(q->val != v) {
			nextpc();
			p->as = ABCASE;
			patch(p, def);
			v++;
		}
		nextpc();
		p->as = ABCASE;
		patch(p, q->label);
		q++;
		v++;
	}
	gbranch(OGOTO);		/* so that regopt() won't be confused */
	patch(p, def);
}
开发者ID:ZhuZhiMing,项目名称:go-internals,代码行数:66,代码来源:swt.c


示例6: patch

void UGen::patch( AudioOutput & output )
{
	patch( output.mSummer );
	setSampleRate( output.sampleRate() );
	setAudioChannelCount( output.getFormat().getChannels() );
}
开发者ID:EQ4,项目名称:minim-cpp,代码行数:6,代码来源:UGen.cpp


示例7: TNbr

void CFDHAMfluidMoistureCoupledMixedFvPatchScalarField::updateCoeffs()
{
    if (updated())
    {
        return;
    }

    // Since we're inside initEvaluate/evaluate there might be processor
    // comms underway. Change the tag we use.
    int oldTag = UPstream::msgType();
    UPstream::msgType() = oldTag+1;

    // Get the coupling information from the mappedPatchBase
    const mappedPatchBase& mpp =
        refCast<const mappedPatchBase>(patch().patch());
    const polyMesh& nbrMesh = mpp.sampleMesh();
    const label samplePatchI = mpp.samplePolyPatch().index();
    const fvPatch& nbrPatch =
        refCast<const fvMesh>(nbrMesh).boundary()[samplePatchI];

//    scalarField Tc(patchInternalField());
    scalarField& Tp = *this;

/*    const mixedFvPatchScalarField& //CFDHAMfluidMoistureCoupledMixedFvPatchScalarField&
        nbrField = refCast
            <const mixedFvPatchScalarField>
            (
                nbrPatch.lookupPatchField<volScalarField, scalar>(wnbrName_)
            );   */

    const mixedFvPatchScalarField& //CFDHAMfluidMoistureCoupledMixedFvPatchScalarField&
        nbrTField = refCast
            <const mixedFvPatchScalarField>
            (
                nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
            );   

    const mixedFvPatchScalarField& //CFDHAMfluidMoistureCoupledMixedFvPatchScalarField&
        nbrpcField = refCast
            <const mixedFvPatchScalarField>
            (
                nbrPatch.lookupPatchField<volScalarField, scalar>("pc")
            );                       

    // Swap to obtain full local values of neighbour internal field
//    scalarField wcNbr(nbrField.patchInternalField());
//    mpp.distribute(wcNbr);

    scalarField TNbr(nbrTField.patchInternalField());
    mpp.distribute(TNbr);  

    scalarField pcNbr(nbrpcField.patchInternalField());
    mpp.distribute(pcNbr); 

    scalarField p(Tp.size(), 0.0);
        p = patch().lookupPatchField<volScalarField, scalar>("p");    

    scalarField rhoair(Tp.size(), 0.0);
        rhoair = patch().lookupPatchField<volScalarField, scalar>("rho");            

    scalar rhol=1.0e3; scalar Rv=8.31451*1000/(18.01534);
    scalarField pvsat_s = exp(6.58094e1-7.06627e3/TNbr-5.976*log(TNbr));
    
    scalarField pv_s = pvsat_s*exp((pcNbr)/(rhol*Rv*TNbr));
    
    valueFraction() = 1.0;//KDeltaNbr/(KDeltaNbr + KDelta);
    refValue() = 0.62198*pv_s/p;//pv_s/pvsat_s;
    refGrad() = 0.0;//(Qr + QrNbr + Qs + QsNbr)/(kappa(Tp));

    mixedFvPatchScalarField::updateCoeffs();

/*    if (debug)
    {
        scalar Q = gSum(kappa(Tp)*patch().magSf()*snGrad());

        Info<< patch().boundaryMesh().mesh().name() << ':'
            << patch().name() << ':'
            << this->dimensionedInternalField().name() << " <- "
            << nbrMesh.name() << ':'
            << nbrPatch.name() << ':'
            << this->dimensionedInternalField().name() << " :"
            << " heat transfer rate:" << Q
            << " walltemperature "
            << " min:" << gMin(Tp)
            << " max:" << gMax(Tp)
            << " avg:" << gAverage(Tp)
            << endl;
    } */

    // Restore tag
    UPstream::msgType() = oldTag;

}
开发者ID:lento234,项目名称:OF-2.3.x,代码行数:93,代码来源:CFDHAMfluidMoistureCoupledMixedFvPatchScalarField.C


示例8: encode_contact

int
encode_contact (struct sip_msg *msg, char *encoding_prefix,char *public_ip)
{

	contact_body_t *cb;
	contact_t *c;
	str* uri;
	str newUri;
	int res;
	char separator;



	/*
	 * I have a list of contacts in contact->parsed which is of type contact_body_t 
	 * inside i have a contact->parsed->contact which is the head of the list of contacts
	 * inside it is a 
	 * str uri;
	 * struct contact *next;
	 * I just have to visit each uri and encode each uri according to a scheme
	 */
	
	if ((msg->contact == NULL)&&((parse_headers(msg,HDR_CONTACT_F,0) == -1) ||
				(msg->contact == NULL) ))
		{
		LOG(L_ERR,"ERROR: encode_contact: no Contact header present\n");
		return -1;
		}


	separator = DEFAULT_SEPARATOR[0];
	if (contact_flds_separator != NULL)
		if (strlen(contact_flds_separator)>=1)
			separator = contact_flds_separator[0];
	
	if (msg->contact->parsed == NULL)	parse_contact (msg->contact);
	if (msg->contact->parsed != NULL)
	{
		cb = (contact_body_t *) msg->contact->parsed;
		c = cb->contacts;
		/* we visit each contact */
		if (c != NULL)
		{
			uri = &c->uri;
			res = encode_uri(msg, uri, encoding_prefix, public_ip,
								separator, &newUri);
			
			if (res != 0)
				{
				LOG (L_ERR,"ERROR: encode_contact: Failed encoding contact.Code %d\n", res);
				return res;
				}
			else
				if (patch (msg, uri->s, uri->len, newUri.s, newUri.len) < 0)
				{
					LOG (L_ERR,"ERROR: encode_contact: lumping failed in mangling port \n");
					return -2;
				}
			
			/* encoding next contacts too?*/
#ifdef ENCODE_ALL_CONTACTS
			while (c->next != NULL)
			{
				c = c->next;
				uri = &c->uri;
				
				res = encode_uri (msg, uri, encoding_prefix, public_ip, 
									separator, &newUri);
				if (res != 0)
					{
					LOG(L_ERR,"ERROR: encode_contact: Failed encode_uri.Code %d\n",res);
#ifdef STRICT_CHECK
				return res;
#endif
					}
				else
				if (patch (msg, uri->s, uri->len, newUri.s, newUri.len)< 0)
				{
					LOG (L_ERR,"ERROR: encode_contact: lumping failed in mangling port \n");
					return -3;
				}
			} /* while */
#endif /* ENCODE_ALL_CONTACTS */
		} /* if c != NULL */

	} /* end if */
	else /* after parsing still NULL */
		{
			LOG(L_ERR,"ERROR: encode_contact: Unable to parse Contact header\n");
#ifdef EXTRA_DEBUG
    			printf("ERROR: encode_contact: Unable to parse Contact header\n");
#endif                        
			return -4;
		}
#ifdef EXTRA_DEBUG
	fprintf (stdout,"---END--------ENCODE CONTACT-----------------\n");
#endif
	return 1;
}
开发者ID:halan,项目名称:kamailio,代码行数:99,代码来源:contact_ops.c


示例9: patch

void Foam::totalPressureFvPatchScalarField::updateCoeffs
(
    const scalarField& p0p,
    const vectorField& Up
)
{
    if (updated())
    {
        return;
    }

    const fvsPatchField<scalar>& phip =
        patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);

    if (psiName_ == "none" && rhoName_ == "none")
    {
        operator==(p0p - 0.5*(1.0 - pos(phip))*magSqr(Up));
    }
    else if (rhoName_ == "none")
    {
        const fvPatchField<scalar>& psip =
            patch().lookupPatchField<volScalarField, scalar>(psiName_);

        if (gamma_ > 1.0)
        {
            scalar gM1ByG = (gamma_ - 1.0)/gamma_;

            operator==
            (
                p0p
                /pow
                (
                    (1.0 + 0.5*psip*gM1ByG*(1.0 - pos(phip))*magSqr(Up)),
                    1.0/gM1ByG
                )
            );
        }
        else
        {
            operator==(p0p/(1.0 + 0.5*psip*(1.0 - pos(phip))*magSqr(Up)));
        }
    }
    else if (psiName_ == "none")
    {
        const fvPatchField<scalar>& rho =
            patch().lookupPatchField<volScalarField, scalar>(rhoName_);

        operator==(p0p - 0.5*rho*(1.0 - pos(phip))*magSqr(Up));
    }
    else
    {
        FatalErrorIn
        (
            "totalPressureFvPatchScalarField::updateCoeffs()"
        )   << " rho or psi set inconsistently, rho = " << rhoName_
            << ", psi = " << psiName_ << ".\n"
            << "    Set either rho or psi or neither depending on the "
            "definition of total pressure." << nl
            << "    Set the unused variable(s) to 'none'.\n"
            << "    on patch " << this->patch().name()
            << " of field " << this->dimensionedInternalField().name()
            << " in file " << this->dimensionedInternalField().objectPath()
            << exit(FatalError);
    }

    fixedValueFvPatchScalarField::updateCoeffs();
}
开发者ID:AmaneShino,项目名称:OpenFOAM-2.0.x,代码行数:67,代码来源:totalPressureFvPatchScalarField.C


示例10: db

tmp<scalarField>
alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::calcAlphat
(
    const scalarField& prevAlphat
) const
{

    // Lookup the fluid model
    const phaseSystem& fluid =
        db().lookupObject<phaseSystem>("phaseProperties");

    const phaseModel& phase
    (
        fluid.phases()[internalField().group()]
    );

    const label patchi = patch().index();

    // Retrieve turbulence properties from model
    const phaseCompressibleTurbulenceModel& turbModel =
        db().lookupObject<phaseCompressibleTurbulenceModel>
        (
            IOobject::groupName(turbulenceModel::propertiesName, phase.name())
        );

    const scalar Cmu25 = pow025(Cmu_);

    const scalarField& y = turbModel.y()[patchi];

    const tmp<scalarField> tmuw = turbModel.mu(patchi);
    const scalarField& muw = tmuw();

    const tmp<scalarField> talphaw = phase.thermo().alpha(patchi);
    const scalarField& alphaw = talphaw();

    const tmp<volScalarField> tk = turbModel.k();
    const volScalarField& k = tk();
    const fvPatchScalarField& kw = k.boundaryField()[patchi];

    const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
    const scalarField magUp(mag(Uw.patchInternalField() - Uw));
    const scalarField magGradUw(mag(Uw.snGrad()));

    const fvPatchScalarField& rhow = turbModel.rho().boundaryField()[patchi];
    const fvPatchScalarField& hew =
        phase.thermo().he().boundaryField()[patchi];

    const fvPatchScalarField& Tw =
        phase.thermo().T().boundaryField()[patchi];

    scalarField Tp(Tw.patchInternalField());

    // Heat flux [W/m2] - lagging alphatw
    const scalarField qDot
    (
        (prevAlphat + alphaw)*hew.snGrad()
    );

    scalarField uTau(Cmu25*sqrt(kw));

    scalarField yPlus(uTau*y/(muw/rhow));

    scalarField Pr(muw/alphaw);

    // Molecular-to-turbulent Prandtl number ratio
    scalarField Prat(Pr/Prt_);

    // Thermal sublayer thickness
    scalarField P(this->Psmooth(Prat));

    scalarField yPlusTherm(this->yPlusTherm(P, Prat));

    tmp<scalarField> talphatConv(new scalarField(this->size()));
    scalarField& alphatConv = talphatConv.ref();

    // Populate boundary values
    forAll(alphatConv, facei)
    {
        // Evaluate new effective thermal diffusivity
        scalar alphaEff = 0.0;
        if (yPlus[facei] < yPlusTherm[facei])
        {
            scalar A = qDot[facei]*rhow[facei]*uTau[facei]*y[facei];
            scalar B = qDot[facei]*Pr[facei]*yPlus[facei];
            scalar C = Pr[facei]*0.5*rhow[facei]*uTau[facei]*sqr(magUp[facei]);
            alphaEff = A/(B + C + vSmall);
        }
        else
        {
            scalar A = qDot[facei]*rhow[facei]*uTau[facei]*y[facei];
            scalar B =
                qDot[facei]*Prt_*(1.0/kappa_*log(E_*yPlus[facei]) + P[facei]);
            scalar magUc =
                uTau[facei]/kappa_*log(E_*yPlusTherm[facei]) - mag(Uw[facei]);
            scalar C =
                0.5*rhow[facei]*uTau[facei]
               *(Prt_*sqr(magUp[facei]) + (Pr[facei] - Prt_)*sqr(magUc));
            alphaEff = A/(B + C + vSmall);
        }

//.........这里部分代码省略.........
开发者ID:OpenFOAM,项目名称:OpenFOAM-dev,代码行数:101,代码来源:alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C


示例11: decode_contact_header

int
decode_contact_header (struct sip_msg *msg,char *unused1,char *unused2)
{

	contact_body_t *cb;
	contact_t *c;
	str* uri;
	str newUri;
	char separator;
	int res;
	
	

	if ((msg->contact == NULL)&&((parse_headers(msg,HDR_CONTACT_F,0) == -1) || 
				(msg->contact== NULL) ))
		{
		LOG(L_ERR,"ERROR: decode_contact_header: no Contact header present\n");
		return -1;
		}

	separator = DEFAULT_SEPARATOR[0];
	if (contact_flds_separator != NULL)
		if (strlen(contact_flds_separator)>=1)
			separator = contact_flds_separator[0];
		
	if (msg->contact->parsed == NULL) parse_contact (msg->contact);
	if (msg->contact->parsed != NULL)
	{
		cb = (contact_body_t *) msg->contact->parsed;
		c = cb->contacts;
		// we visit each contact 
	 if (c != NULL)
	  {
		uri = &c->uri;

		res = decode_uri (uri, separator, &newUri, 0);
		if (res != 0)
		{
			LOG (L_ERR,"ERROR: decode_contact_header:Failed decoding contact.Code %d\n", res);
#ifdef STRICT_CHECK
				return res;
#endif
		}
		else
		if (patch (msg, uri->s, uri->len, newUri.s, newUri.len) < 0)
		{
			LOG (L_ERR,"ERROR: decode_contact:lumping failed in mangling port \n");
			return -2;
		}

#ifdef DECODE_ALL_CONTACTS
		while (c->next != NULL)
		{
			c = c->next;
			uri = &c->uri;

			res = decode_uri (uri, separator, &newUri, 0);
			if (res != 0)
				{
				LOG (L_ERR,"ERROR: decode_contact: Failed decoding contact.Code %d\n",res);
#ifdef STRICT_CHECK
				return res;
#endif
				}
			else
			if (patch (msg, uri->s, uri->len, newUri.s, newUri.len) < 0)
			{
				LOG (L_ERR,"ERROR: decode_contact:lumping failed in mangling port \n");
				return -3;
			}
		} // end while 
#endif
	   } // if c!= NULL 
	} // end if 
	else // after parsing still NULL 
		{
			LOG(L_ERR,"ERROR: decode_contact: Unable to parse Contact header\n");
			return -4;
		}
	return 1;
}
开发者ID:halan,项目名称:kamailio,代码行数:81,代码来源:contact_ops.c


示例12: updateCoeffs

void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs()
{
    updateCoeffs(patch().lookupPatchField<volVectorField, vector>(UName_));
}
开发者ID:Kiiree,项目名称:RapidCFD-dev,代码行数:4,代码来源:uniformTotalPressureFvPatchScalarField.C


示例13: abort

void Foam::processorTetPolyPatchFaceDecomp::calcMeshPoints() const
{
    if (meshPointsPtr_)
    {
        FatalErrorIn
        (
            "void processorTetPolyPatchFaceDecomp::calcMeshPoints() const"
        )   << "meshPointsPtr_ already allocated"
            << abort(FatalError);
    }

    // Algorithm:
    // Depending on whether the patch is a master or a slave, get the primitive
    // patch points and filter away the points from the global patch.

    labelList mp(0);

    if (isMaster())
    {
        mp = procPolyPatch_.meshPoints();
    }
    else
    {
        // Slave side.  Create the reversed patch and pick up its points
        // so that the order is correct
        const polyPatch& pp = patch();

        faceList masterFaces(pp.size());

        forAll (pp, faceI)
        {
            masterFaces[faceI] = pp[faceI].reverseFace();
        }

        mp = primitiveFacePatch
            (
                masterFaces,
                pp.points()
            ).meshPoints();
    }

    // Get reference to shared processor points
    const labelList& sharedPoints =
        boundaryMesh().globalPatch().meshPoints();

    // Filter the shared points out of the list
    meshPointsPtr_ = new labelList(mp.size() + procPolyPatch_.size());
    labelList& filtPoints = *meshPointsPtr_;

    label noFiltPoints = 0;

    forAll (mp, pointI)
    {
        label curP = mp[pointI];

        bool found = false;
        forAll (sharedPoints, sharedI)
        {
            if (sharedPoints[sharedI] == curP)
            {
                found = true;
                break;
            }
        }

        if (!found)
        {
            filtPoints[noFiltPoints] = curP;
            noFiltPoints++;
        }
    }
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-Core-OpenFOAM-1.5-dev,代码行数:71,代码来源:calcProcessorTetPolyPatchFaceDecompPointAddr.C


示例14: boundaryMesh

                found = true;
                break;
            }
        }

        if (!found)
        {
            filtPoints[noFiltPoints] = curP;
            noFiltPoints++;
        }
    }

    // insert faces using the offset
    // These cannot be shared
    const label faceOffset = boundaryMesh().mesh().faceOffset();

    const label polyPatchStart = patch().start() + faceOffset;
    const label polyPatchStartPlusSize = polyPatchStart + patch().size();

    for (label i = polyPatchStart; i < polyPatchStartPlusSize; i++)
    {
        filtPoints[noFiltPoints] = i;
        noFiltPoints++;
    }

    filtPoints.setSize(noFiltPoints);
}


// ************************************************************************* //
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-Core-OpenFOAM-1.5-dev,代码行数:30,代码来源:calcProcessorTetPolyPatchFaceDecompPointAddr.C


示例15: patch

int HttpClient::patch(const char* aURLPath, const char* aContentType, const char* aBody)
{
    return patch(aURLPath, aContentType, strlen(aBody),  (const byte*)aBody);
}
开发者ID:DawesLab,项目名称:arduino,代码行数:4,代码来源:HttpClient.cpp


示例16: FAILED

inline patch patch_rep::get_child (int i) {
  FAILED ("not a composite patch"); (void) i; return patch (); }
开发者ID:KarlHegbloom,项目名称:texmacs,代码行数:2,代码来源:patch.hpp


示例17: scalarField

tmp<scalarField> nutLowReWallFunctionFvPatchScalarField::calcNut() const
{
    return tmp<scalarField>(new scalarField(patch().size(), 0.0));
}
开发者ID:OpenFOAM,项目名称:OpenFOAM-2.0.x,代码行数:4,代码来源:nutLowReWallFunctionFvPatchScalarField.C


示例18: _cgen


//.........这里部分代码省略.........
		regalloc(&nod, r, nn);
		if(l->complex >= r->complex) {
			reglcgen(&nod1, n, Z);
			cgen(r, &nod);
		} else {
			cgen(r, &nod);
			reglcgen(&nod1, n, Z);
		}
		regalloc(&nod2, n, Z);
		gopcode(OAS, &nod1, Z, &nod2);
		bitstore(l, &nod, &nod1, &nod2, nn);
		break;

	case OBIT:
		if(nn == Z) {
			nullwarn(l, Z);
			break;
		}
		bitload(n, &nod, Z, Z, nn);
		gopcode(OAS, &nod, Z, nn);
		regfree(&nod);
		break;

	case ODIV:
	case OMOD:
		if(nn != Z)
		if((t = vlog(r)) >= 0) {
			/* signed div/mod by constant power of 2 */
			cgen(l, nn);
			gopcode(OGE, nodconst(0), nn, Z);
			p1 = p;
			if(o == ODIV) {
				gopcode(OADD, nodconst((1<<t)-1), Z, nn);
				patch(p1, pc);
				gopcode(OASHR, nodconst(t), Z, nn);
			} else {
				gopcode(OSUB, nn, nodconst(0), nn);
				gopcode(OAND, nodconst((1<<t)-1), Z, nn);
				gopcode(OSUB, nn, nodconst(0), nn);
				gbranch(OGOTO);
				patch(p1, pc);
				p1 = p;
				gopcode(OAND, nodconst((1<<t)-1), Z, nn);
				patch(p1, pc);
			}
			break;
		}
		goto muldiv;

	case OSUB:
		if(nn != Z)
		if(l->op == OCONST)
		if(!typefd[n->type->etype]) {
			cgen(r, nn);
			gopcode(o, Z, l, nn);
			break;
		}
	case OADD:
	case OAND:
	case OOR:
	case OXOR:
	case OLSHR:
	case OASHL:
	case OASHR:
		/*
		 * immediate operands
开发者ID:Ahmah2009,项目名称:golang,代码行数:67,代码来源:cgen.c


示例19: main


//.........这里部分代码省略.........
			INITTEXT = 4096+HEADR;
		if(INITDAT == -1)
			INITDAT = 0;
		if(INITRND == -1)
			INITRND = 4096;
		break;
	case Hlinux:	/* elf32 executable */
	case Hfreebsd:
	case Hnetbsd:
	case Hopenbsd:
		/*
		 * ELF uses TLS offsets negative from %gs.
		 * Translate 0(GS) and 4(GS) into -8(GS) and -4(GS).
		 * Also known to ../../pkg/runtime/sys_linux_386.s
		 * and ../../pkg/runtime/cgo/gcc_linux_386.c.
		 */
		tlsoffset = -8;
		elfinit();
		HEADR = ELFRESERVE;
		if(INITTEXT == -1)
			INITTEXT = 0x08048000+HEADR;
		if(INITDAT == -1)
			INITDAT = 0;
		if(INITRND == -1)
			INITRND = 4096;
		break;
	case Hwindows: /* PE executable */
		peinit();
		HEADR = PEFILEHEADR;
		if(INITTEXT == -1)
			INITTEXT = PEBASE+PESECTHEADR;
		if(INITDAT == -1)
			INITDAT = 0;
		if(INITRND == -1)
			INITRND = PESECTALIGN;
		break;
	}
	if(INITDAT != 0 && INITRND != 0)
		print("warning: -D0x%ux is ignored because of -R0x%ux\n",
			INITDAT, INITRND);
	if(debug['v'])
		Bprint(&bso, "HEADER = -H0x%d -T0x%ux -D0x%ux -R0x%ux\n",
			HEADTYPE, INITTEXT, INITDAT, INITRND);
	Bflush(&bso);

	instinit();
	zprg.link = P;
	zprg.pcond = P;
	zprg.back = 2;
	zprg.as = AGOK;
	zprg.from.type = D_NONE;
	zprg.from.index = D_NONE;
	zprg.from.scale = 1;
	zprg.to = zprg.from;

	pcstr = "%.6ux ";
	histgen = 0;
	pc = 0;
	dtype = 4;
	version = 0;
	cbp = buf.cbuf;
	cbc = sizeof(buf.cbuf);

	addlibpath("command line", "command line", argv[0], "main");
	loadlib();
	deadcode();
	patch();
	follow();
	doelf();
	if(HEADTYPE == Hdarwin)
		domacho();
	if(HEADTYPE == Hwindows)
		dope();
	dostkoff();
	if(debug['p'])
		if(debug['1'])
			doprof1();
		else
			doprof2();
	span();
	addexport();
	textaddress();
	pclntab();
	symtab();
	dodata();
	address();
	doweak();
	reloc();
	asmb();
	undef();
	if(debug['v']) {
		Bprint(&bso, "%5.2f cpu time\n", cputime());
		Bprint(&bso, "%d symbols\n", nsymbol);
		Bprint(&bso, "%d sizeof adr\n", sizeof(Adr));
		Bprint(&bso, "%d sizeof prog\n", sizeof(Prog));
	}
	Bflush(&bso);

	errorexit();
}
开发者ID:pipul,项目名称:lab,代码行数:101,代码来源:obj.c


示例20: go

int go()
{
	TCHAR filename[MAX_PATH + 1];
	HANDLE file;

	GetModuleFileName(NULL, filename, MAX_PATH);
	file = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);

	if(file != INVALID_HANDLE_VALUE)
	{
		footer_t footer;
		DWORD read;
		int offset = -sizeof(footer_t);

		SetFilePointer(file, offset, NULL, FILE_END);
		ReadFile(file, &footer, sizeof(footer_t), &read, NULL);
		
		if(memcmp(footer.sig, SIG, sizeof(SIG) - 1) == 0)
		{ // sig ok
			int i;
			char *buffer;
			int buffer_size = 1;
			patch_footer_t patch_footer;
			g_exe_name = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, footer.exe_name_len + 1);

			// get exe name
			offset -= footer.exe_name_len;
			SetFilePointer(file, offset, NULL, FILE_END);
			ReadFile(file, g_exe_name, footer.exe_name_len, &read, NULL);

			// create process
			if(! process())
				return 0;

			// read patch information
			buffer = HeapAlloc(GetProcessHeap(), 0, buffer_size);

			for(i = 0; i < footer.npatches; i++)
			{
				offset -= sizeof(patch_footer_t);
				SetFilePointer(file, offset, NULL, FILE_END);
				ReadFile(file, &patch_footer, sizeof(patch_footer_t), &read, NULL);

				if(patch_footer.size * 2 > buffer_size)
				{
					buffer = HeapReAlloc(GetProcessHeap(), 0, buffer, patch_footer.size * 2);
					buffer_size = patch_footer.size * 2;
				}

				offset -= patch_footer.size * 2;
				SetFilePointer(file, offset, NULL, FILE_END);
				ReadFile(file, buffer, patch_footer.size * 2, &read, NULL);

				if(! patch(patch_footer.address, buffer, buffer + patch_footer.size, patch_footer.size))
					return 0;
			}

			HeapFree(GetProcessHeap(), 0, g_exe_name);
			HeapFree(GetProcessHeap(), 0, buffer);
		}

		CloseHandle(file);
	}
	return 1;
}
开发者ID:piec,项目名称:OllyDbgLauncher,代码行数:65,代码来源:main.c



注:本文中的patch函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ patchInternalField函数代码示例发布时间:2022-05-30
下一篇:
C++ password函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap