本文整理汇总了C++中TriMesh::areaElem方法的典型用法代码示例。如果您正苦于以下问题:C++ TriMesh::areaElem方法的具体用法?C++ TriMesh::areaElem怎么用?C++ TriMesh::areaElem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TriMesh
的用法示例。
在下文中一共展示了TriMesh::areaElem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pack
void DumpMeshVTK::pack(int *ids)
{
int m = 0;
double node[3];
TriMesh *mesh;
ScalarContainer<double> *cb1;
VectorContainer<double,3> *cb2;
double **tmp;
memory->create<double>(tmp,3,3,"DumpMeshVTK:tmp");
// have to stick with this order (all per-element props)
// as multiple procs pack
for(int iMesh = 0;iMesh < nMesh_; iMesh++)
{
mesh = meshList_[iMesh];
if(!mesh->isParallel() && 0 != comm->me)
continue;
int nlocal = meshList_[iMesh]->sizeLocal();
for(int iTri = 0; iTri < nlocal; iTri++)
{
for(int j=0;j<3;j++)
{
mesh->node(iTri,j,node);
for(int k=0;k<3;k++)
buf[m++] = node[k];
}
if(dump_what_ & DUMP_STRESS)
{
buf[m++] = sigma_n_[iMesh] ? sigma_n_[iMesh]->get(iTri) : 0.;
buf[m++] = sigma_t_[iMesh] ? sigma_t_[iMesh]->get(iTri) : 0.;
}
if(dump_what_ & DUMP_STRESSCOMPONENTS)
{
double invArea = 1./mesh->areaElem(iTri);
double f[3];
if(f_node_[iMesh])
f_node_[iMesh]->get(iTri,f);
else
vectorZeroize3D(f);
buf[m++] = f[0]*invArea;
buf[m++] = f[1]*invArea;
buf[m++] = f[2]*invArea;
}
if(dump_what_ & DUMP_ID)
{
buf[m++] = static_cast<double>(mesh->id(iTri));
}
if(dump_what_ & DUMP_VEL)
{
double avg[3];
if(v_node_[iMesh])
{
// get vel for element, copy it to tmp
v_node_[iMesh]->get(iTri,tmp);
// calculate average
vectorZeroize3D(avg);
vectorCopy3D(tmp[0],avg);
vectorAdd3D(tmp[1],avg,avg);
vectorAdd3D(tmp[2],avg,avg);
vectorScalarDiv3D(avg,3.);
}
else
vectorZeroize3D(avg);
// push to buffer
buf[m++] = avg[0];
buf[m++] = avg[1];
buf[m++] = avg[2];
}
if(dump_what_ & DUMP_WEAR)
{
buf[m++] = wear_[iMesh] ? wear_[iMesh]->get(iTri) : 0.;
}
if(dump_what_ & DUMP_TEMP)
{
buf[m++] = (temp_per_element_[iMesh]) ? (T_[iMesh]->get(iTri)) : (T_[iMesh] ? T_[iMesh]->get(0) : 0.);
}
if(dump_what_ & DUMP_OWNER)
{
int me = comm->me;
buf[m++] = static_cast<double>(me);
}
if(dump_what_ & DUMP_AREA)
{
buf[m++] = mesh->areaElem(iTri);
}
//.........这里部分代码省略.........