v0.16.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ZeroFLmabda Struct Reference

Zero F_lambda. More...

#include "tutorials/cor-12_cohesive_interface/src/ArcLengthTools.hpp"

Inheritance diagram for ZeroFLmabda:
[legend]
Collaboration diagram for ZeroFLmabda:
[legend]

Public Member Functions

 ZeroFLmabda (boost::shared_ptr< ArcLengthCtx > arc_ptr)
 
MoFEMErrorCode preProcess ()
 
 ZeroFLmabda (boost::shared_ptr< ArcLengthCtx > arc_ptr)
 
MoFEMErrorCode preProcess ()
 

Public Attributes

boost::shared_ptr< ArcLengthCtxarcPtr
 

Detailed Description

Zero F_lambda.

Definition at line 281 of file ArcLengthTools.hpp.

Constructor & Destructor Documentation

◆ ZeroFLmabda() [1/2]

ZeroFLmabda::ZeroFLmabda ( boost::shared_ptr< ArcLengthCtx arc_ptr)

Definition at line 349 of file ArcLengthTools.cpp.

350 : arcPtr(arc_ptr) {}
boost::shared_ptr< ArcLengthCtx > arcPtr

◆ ZeroFLmabda() [2/2]

ZeroFLmabda::ZeroFLmabda ( boost::shared_ptr< ArcLengthCtx arc_ptr)

Member Function Documentation

◆ preProcess() [1/2]

MoFEMErrorCode ZeroFLmabda::preProcess ( )

Definition at line 352 of file ArcLengthTools.cpp.

352 {
354 switch (snes_ctx) {
355 case CTX_SNESSETFUNCTION: {
356
357 auto zero_vals = [&](auto v) {
359 int size = problemPtr->getNbLocalDofsRow();
360 int ghosts = problemPtr->getNbGhostDofsRow();
361 double *array;
362 CHKERR VecGetArray(v, &array);
363 for (int i = 0; i != size + ghosts; ++i)
364 array[i] = 0;
365 CHKERR VecRestoreArray(v, &array);
367 };
368
369 Vec l_x_lambda, l_f_lambda;
370 CHKERR VecGhostGetLocalForm(arcPtr->xLambda, &l_x_lambda);
371 CHKERR VecGhostGetLocalForm(arcPtr->F_lambda, &l_f_lambda);
372 CHKERR zero_vals(l_x_lambda);
373 CHKERR zero_vals(l_f_lambda);
374 CHKERR VecGhostRestoreLocalForm(arcPtr->xLambda, &l_x_lambda);
375 CHKERR VecGhostRestoreLocalForm(arcPtr->F_lambda, &l_f_lambda);
376
377 } break;
378 default:
379 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
380 "Lambda can be zeroed ONLY when the right hand side is evaluated.");
381 }
383}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
FTensor::Index< 'i', SPACE_DIM > i
const double v
phase velocity of light in medium (cm/ns)
const FTensor::Tensor2< T, Dim, Dim > Vec

◆ preProcess() [2/2]

MoFEMErrorCode ZeroFLmabda::preProcess ( )

Member Data Documentation

◆ arcPtr

boost::shared_ptr< ArcLengthCtx > ZeroFLmabda::arcPtr

Definition at line 283 of file ArcLengthTools.hpp.


The documentation for this struct was generated from the following files: