Pre process time step.
cut-off values at nodes, i.e. abs("H") <= 1
2872 {
2874
2876
2877
2878
2879
2880
2881 auto cut_off_dofs = [&]() {
2883
2884 auto &m_field = ptr->fsRawPtr->mField;
2885
2886 Range current_verts;
2890
2891 auto cut_off_verts = [&](boost::shared_ptr<FieldEntity> ent_ptr) {
2893 for (
auto &
h : ent_ptr->getEntFieldData()) {
2895 }
2897 };
2898
2899 auto field_blas = m_field.getInterface<
FieldBlas>();
2901 ¤t_verts);
2903 };
2904
2906 }
2907
2909 MOFEM_LOG(
"FS", Sev::inform) <<
"Run step pre proc";
2910
2911 auto &m_field = ptr->fsRawPtr->mField;
2913
2914
2915 auto get_norm = [&](auto x) {
2916 double nrm;
2917 CHKERR VecNorm(x, NORM_2, &nrm);
2918 return nrm;
2919 };
2920
2921
2922 auto refine_problem = [&]() {
2924 MOFEM_LOG(
"FS", Sev::inform) <<
"Refine problem";
2926 CHKERR ptr->fsRawPtr->projectData();
2928 };
2929
2930
2931
2932 auto set_jacobian_operators = [&]() {
2935 CHKERR KSPReset(ptr->subKSP);
2937 };
2938
2939
2940 auto set_solution = [&]() {
2942 MOFEM_LOG(
"FS", Sev::inform) <<
"Set solution";
2943
2944 PetscObjectState state;
2945
2946
2947
2948
2949
2950
2951
2952
2955 INSERT_VALUES, SCATTER_FORWARD);
2958 << "Set solution, vector norm " << get_norm(ptr->globSol);
2960 };
2961
2962 PetscBool is_theta;
2963 PetscObjectTypeCompare((PetscObject)ts, TSTHETA, &is_theta);
2964 if (is_theta) {
2965
2967 CHKERR set_jacobian_operators();
2969
2970 } else {
2972 "Sorry, only TSTheta handling is implemented");
2973 }
2974
2975
2976
2977 PetscBarrier((PetscObject)ts);
2978
2982 }
2983
2985}
void simple(double P1[], double P2[], double P3[], double c[], const int N)
auto get_current_bit
dofs bit used to do calculations
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
auto createDMMatrix(DM dm)
Get smart matrix from DM.
MoFEMErrorCode getEntitiesByTypeAndRefLevel(const BitRefLevel bit, const BitRefLevel mask, const EntityType type, const EntityHandle meshset, int verb=0) const
add all ents from ref level given by bit to meshset
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
PetscObject getPetscObject(T obj)
MoFEMErrorCode fieldLambdaOnEntities(OneFieldFunctionOnEntities lambda, const std::string field_name, Range *ents_ptr=nullptr)
field lambda
Simple interface for fast problem set-up.