예제 #1
0
void NuTo::Structure::InterpolationTypeAdd(int rInterpolationTypeId, NuTo::Node::eDof rDofType,
                                           NuTo::Interpolation::eTypeOrder rTypeOrder, const Eigen::VectorXi& rDegree,
                                           const std::vector<Eigen::VectorXd>& rKnots, const Eigen::MatrixXd& rWeights)
{
    InterpolationType* interpolationType = InterpolationTypeGet(rInterpolationTypeId);
    interpolationType->AddDofInterpolation(rDofType, rTypeOrder, rDegree, rKnots, rWeights);

    eIntegrationType integrationTypeEnum = interpolationType->GetStandardIntegrationType();
    const IntegrationTypeBase& integrationType = *this->GetPtrIntegrationType(integrationTypeEnum);

    interpolationType->ClearCache();

    // update all elements
    // disable show time

    bool showTime = GetShowTime();
    SetShowTime(false);

    int elementGroupId = GroupCreate("Elements");
    GroupAddElementFromType(elementGroupId, rInterpolationTypeId);

    for (int elementId : GroupGetMemberIds(elementGroupId))
    {
        ElementBase* element = ElementGetElementPtr(elementId);
        element->SetIntegrationType(integrationType);
    }

    GroupDelete(elementGroupId);
    UpdateDofStatus();
    SetShowTime(showTime);
}
예제 #2
0
void NuTo::Structure::InterpolationTypeAdd(
        int rInterpolationTypeId, NuTo::Node::eDof rDofType,
        NuTo::Interpolation::eTypeOrder rTypeOrder = Interpolation::eTypeOrder::EQUIDISTANT1)
{
    InterpolationType& interpolationType = *InterpolationTypeGet(rInterpolationTypeId);
    interpolationType.AddDofInterpolation(rDofType, rTypeOrder);

    eIntegrationType integrationTypeEnum = interpolationType.GetStandardIntegrationType();
    const IntegrationTypeBase& integrationType = *this->GetPtrIntegrationType(integrationTypeEnum);

    interpolationType.ClearCache();

    // update all elements
    // disable show time

    bool showTime = GetShowTime();
    SetShowTime(false);

    int elementGroupId = GroupCreate(eGroupId::Elements);
    GroupAddElementFromType(elementGroupId, rInterpolationTypeId);

    for (int elementId : GroupGetMemberIds(elementGroupId))
    {
        ElementBase* element = ElementGetElementPtr(elementId);
        element->SetIntegrationType(integrationType);
    }

    GroupDelete(elementGroupId);
    UpdateDofStatus();
    SetShowTime(showTime);
}
예제 #3
0
void NuTo::Structure::InterpolationTypeSetIntegrationType(int rInterpolationTypeId,
                                                          IntegrationTypeBase* rIntegrationType)
{
    InterpolationType* interpolationType = InterpolationTypeGet(rInterpolationTypeId);
    interpolationType->ClearCache();

    // update all elements
    // disable show time

    bool showTime = GetShowTime();
    SetShowTime(false);

    int elementGroupId = GroupCreate("Elements");
    GroupAddElementFromType(elementGroupId, rInterpolationTypeId);

    for (int elementId : GroupGetMemberIds(elementGroupId))
    {
        ElementBase* element = ElementGetElementPtr(elementId);
        element->SetIntegrationType(*rIntegrationType);
    }

    GroupDelete(elementGroupId);
    SetShowTime(showTime);
}