| 983 | } |
| 984 | |
| 985 | void ContactBoundary:: |
| 986 | Update(shared_ptr<GridFunction> displacement_, |
| 987 | shared_ptr<BilinearForm> bf, |
| 988 | int intorder, double h, bool both_sides) |
| 989 | { |
| 990 | if(!displacement_ && !bf) |
| 991 | throw Exception("Either displacement or BilinearForm needed in ContactBoundary update!"); |
| 992 | if(!trial_fes) |
| 993 | { |
| 994 | if(bf) |
| 995 | { |
| 996 | trial_fes = bf->GetTrialSpace(); |
| 997 | test_fes = bf->GetTestSpace(); |
| 998 | } |
| 999 | else |
| 1000 | { |
| 1001 | trial_fes = displacement_->GetFESpace(); |
| 1002 | test_fes = displacement_->GetFESpace(); |
| 1003 | } |
| 1004 | } |
| 1005 | if(bf && (bf->GetTrialSpace().get() != trial_fes.get())) |
| 1006 | throw Exception("BilinearForm on different space as given to ContactBoundary!"); |
| 1007 | if(displacement_) |
| 1008 | fes_displacement = displacement_->GetFESpace(); |
| 1009 | |
| 1010 | if(draw_pairs) |
| 1011 | { |
| 1012 | secondary_points.SetSize(0); |
| 1013 | primary_points.SetSize(0); |
| 1014 | } |
| 1015 | |
| 1016 | shared_ptr<GridFunction> displacement = nullptr; |
| 1017 | if(displacement_) |
| 1018 | { |
| 1019 | auto flags = displacement_->GetFlags(); |
| 1020 | flags.SetFlag("novisual"); |
| 1021 | displacement = CreateGridFunction(displacement_->GetFESpace(), "_cb_displacement", flags); |
| 1022 | displacement->Update(); |
| 1023 | displacement->GetVector() = displacement_->GetVector(); |
| 1024 | } |
| 1025 | if (displacement) |
| 1026 | gap->Update(displacement, 10*displacement->GetFESpace()->GetOrder(), h, |
| 1027 | both_sides); |
| 1028 | else |
| 1029 | gap->Update(nullptr, 10, h, both_sides); |
| 1030 | |
| 1031 | auto mesh = trial_fes->GetMeshAccess(); |
| 1032 | if(mesh->GetDimension() == 2) |
| 1033 | static_pointer_cast<DisplacedNormal<2>>(normal)->Update(displacement); |
| 1034 | else |
| 1035 | static_pointer_cast<DisplacedNormal<3>>(normal)->Update(displacement); |
| 1036 | if(bf) |
| 1037 | { |
| 1038 | static Timer t1("Build contact pairs"); |
| 1039 | RegionTimer regt1(t1); |
| 1040 | LocalHeap lh(1000000, "ContactBoundary-Update", true); |
| 1041 | Iterate<2> |
| 1042 | ([&](auto i) |
nothing calls this directly
no test coverage detected