InputParameters validParams<SolidMechanicsAction>() { InputParameters params = validParams<Action>(); MooseEnum elemType("truss undefined", "undefined"); params.addParam<MooseEnum>("type", elemType, "The element type: " + elemType.getRawNames()); params.addParam<NonlinearVariableName>("disp_x", "", "The x displacement"); params.addParam<NonlinearVariableName>("disp_y", "", "The y displacement"); params.addParam<NonlinearVariableName>("disp_z", "", "The z displacement"); params.addParam<NonlinearVariableName>("disp_r", "", "The r displacement"); params.addParam<NonlinearVariableName>("temp", "", "The temperature"); params.addParam<Real>("zeta", 0.0, "Stiffness dependent damping parameter for Rayleigh damping"); params.addParam<Real>("alpha", 0.0, "alpha parameter for HHT time integration"); params.addParam<std::string>("appended_property_name", "", "Name appended to material properties to make them unique"); params.set<bool>("use_displaced_mesh") = true; params.addParam<std::vector<SubdomainName> >("block", "The list of ids of the blocks (subdomain) that these kernels will be applied to"); params.addParam<std::vector<AuxVariableName> >("save_in_disp_x", "Auxiliary variables to save the x displacement residuals."); params.addParam<std::vector<AuxVariableName> >("save_in_disp_y", "Auxiliary variables to save the y displacement residuals."); params.addParam<std::vector<AuxVariableName> >("save_in_disp_z", "Auxiliary variables to save the z displacement residuals."); params.addParam<std::vector<AuxVariableName> >("save_in_disp_r", "Auxiliary variables to save the r displacement residuals."); params.addParam<std::vector<AuxVariableName> >("diag_save_in_disp_x", "Auxiliary variables to save the x displacement diagonal preconditioner terms."); params.addParam<std::vector<AuxVariableName> >("diag_save_in_disp_y", "Auxiliary variables to save the y displacement diagonal preconditioner terms."); params.addParam<std::vector<AuxVariableName> >("diag_save_in_disp_z", "Auxiliary variables to save the z displacement diagonal preconditioner terms."); params.addParam<std::vector<AuxVariableName> >("diag_save_in_disp_r", "Auxiliary variables to save the r displacement diagonal preconditioner terms."); return params; }
bool SMESH_MesherHelper::IsQuadraticSubMesh(const TopoDS_Shape& aSh) { SMESHDS_Mesh* meshDS = GetMeshDS(); // we can create quadratic elements only if all elements // created on subshapes of given shape are quadratic // also we have to fill myNLinkNodeMap myCreateQuadratic = true; mySeamShapeIds.clear(); myDegenShapeIds.clear(); TopAbs_ShapeEnum subType( aSh.ShapeType()==TopAbs_FACE ? TopAbs_EDGE : TopAbs_FACE ); SMDSAbs_ElementType elemType( subType==TopAbs_FACE ? SMDSAbs_Face : SMDSAbs_Edge ); int nbOldLinks = myNLinkNodeMap.size(); TopExp_Explorer exp( aSh, subType ); for (; exp.More() && myCreateQuadratic; exp.Next()) { if ( SMESHDS_SubMesh * subMesh = meshDS->MeshElements( exp.Current() )) { if ( SMDS_ElemIteratorPtr it = subMesh->GetElements() ) { while(it->more()) { const SMDS_MeshElement* e = it->next(); if ( e->GetType() != elemType || !e->IsQuadratic() ) { myCreateQuadratic = false; break; } else { // fill NLinkNodeMap switch ( e->NbNodes() ) { case 3: AddNLinkNode(e->GetNode(0),e->GetNode(1),e->GetNode(2)); break; case 6: AddNLinkNode(e->GetNode(0),e->GetNode(1),e->GetNode(3)); AddNLinkNode(e->GetNode(1),e->GetNode(2),e->GetNode(4)); AddNLinkNode(e->GetNode(2),e->GetNode(0),e->GetNode(5)); break; case 8: AddNLinkNode(e->GetNode(0),e->GetNode(1),e->GetNode(4)); AddNLinkNode(e->GetNode(1),e->GetNode(2),e->GetNode(5)); AddNLinkNode(e->GetNode(2),e->GetNode(3),e->GetNode(6)); AddNLinkNode(e->GetNode(3),e->GetNode(0),e->GetNode(7)); break; default: myCreateQuadratic = false; break; } } } } } } if ( nbOldLinks == myNLinkNodeMap.size() ) myCreateQuadratic = false; if(!myCreateQuadratic) { myNLinkNodeMap.clear(); } SetSubShape( aSh ); return myCreateQuadratic; }
void Array<elemType>::grow() { elemType *oldia = _ia; int oldSize = _size; _size = oldSize + oldSize/2 + 1; _ia = new elemType[_size]; int ix; for ( ix = 0; ix < oldSize; ++ix) _ia[ix] = oldia[ix]; for ( ; ix < _size; ++ix ) _ia[ix] = elemType(); delete[] oldia; }
Type packedArrayElemType(SSATmp* arr, SSATmp* idx, const Class* ctx) { assertx(arr->isA(TArr) && arr->type().arrSpec().kind() == ArrayData::kPackedKind && idx->isA(TInt)); if (arr->hasConstVal() && idx->hasConstVal()) { auto const idxVal = idx->intVal(); if (idxVal >= 0 && idxVal < arr->arrVal()->size()) { return Type(arr->arrVal()->nvGet(idxVal)->m_type); } return TInitNull; } Type t = arr->isA(TPersistentArr) ? TInitCell : TGen; auto const at = arr->type().arrSpec().type(); if (!at) return t; switch (at->tag()) { case RepoAuthType::Array::Tag::Packed: { if (idx->hasConstVal(TInt)) { auto const idxVal = idx->intVal(); if (idxVal >= 0 && idxVal < at->size()) { return typeFromRAT(at->packedElem(idxVal), ctx) & t; } return TInitNull; } Type elemType = TBottom; for (uint32_t i = 0; i < at->size(); ++i) { elemType |= typeFromRAT(at->packedElem(i), ctx); } return elemType & t; } case RepoAuthType::Array::Tag::PackedN: return typeFromRAT(at->elemType(), ctx) & t; } not_reached(); }