bool ApexRenderMeshAsset::createFromParameters(RenderMeshAssetParameters* params) { mParams = params; NxParameterized::Handle handle(*mParams); physx::PxU32 size; // submeshes mParams->getParameterHandle("submeshes", handle); mParams->getArraySize(handle, (physx::PxI32&)size); setSubmeshCount(size); for (physx::PxU32 i = 0; i < size; ++i) { NxParameterized::Handle elementHandle(*mParams); handle.getChildHandle((physx::PxI32)i, elementHandle); NxParameterized::Interface* submeshParams = NULL; mParams->getParamRef(elementHandle, submeshParams); mSubmeshes[i]->setParams(static_cast<SubmeshParameters*>(submeshParams), NULL); } createLocalData(); return true; }
void createOuterContext(OuterContext* & ctx) { int rank; int npes; MPI_Comm_rank(PETSC_COMM_WORLD, &rank); MPI_Comm_size(PETSC_COMM_WORLD, &npes); ctx = new OuterContext; ctx->data = NULL; ctx->root = NULL; ctx->outerMat = PETSC_NULL; ctx->outerKsp = PETSC_NULL; ctx->outerPC = PETSC_NULL; ctx->outerSol = PETSC_NULL; ctx->outerRhs = PETSC_NULL; createLocalData(ctx->data); createRSDtree(ctx->root, rank, npes); createOuterMat(ctx); createOuterPC(ctx); createOuterKsp(ctx); MatGetVecs(ctx->outerMat, &(ctx->outerSol), &(ctx->outerRhs)); }