15 #if !defined(KRATOS_FLAGS_H_INCLUDED )
16 #define KRATOS_FLAGS_H_INCLUDED
57 class KRATOS_API(KRATOS_CORE)
Flags
67 typedef __int64 int64_t;
122 Flags(
Flags const& rOther) : mIsDefined(rOther.mIsDefined), mFlags(rOther.mFlags)
141 flags.SetPosition(ThisPosition, Value);
153 mIsDefined = rOther.mIsDefined;
154 mFlags = rOther.mFlags;
166 Flags results(*
this);
167 results.mFlags = ~mFlags;
173 Flags results(*
this);
174 results.mFlags = !mFlags;
181 mIsDefined = rOther.mIsDefined;
182 mFlags = rOther.mFlags;
189 void Set(
const Flags ThisFlag);
191 void Set(
const Flags ThisFlag,
bool Value);
195 mIsDefined &= (~ThisFlag.mIsDefined);
196 mFlags &= (~ThisFlag.mIsDefined);
201 mIsDefined |= ThisFlag.mIsDefined;
202 mFlags ^= (ThisFlag.mIsDefined);
207 mIsDefined |= (
BlockType(1) << Position);
211 mFlags |= (
BlockType(Value) << Position);
217 return (mFlags & (
BlockType(1) << Position));
223 mIsDefined |= (
BlockType(1) << Position);
230 mIsDefined &= ~((
BlockType(1) << Position));
243 Flags this_flag_false(*
this);
244 this_flag_false.mFlags = !((*this).mFlags);
245 return this_flag_false;
276 return (mFlags & rOther.mFlags) | ((rOther.mIsDefined ^ rOther.mFlags) & (~mFlags));
281 return (mIsDefined & rOther.mIsDefined);
293 return !((mFlags & rOther.mFlags) | ((rOther.mIsDefined ^ rOther.mFlags) & (~mFlags)));
298 return !(mIsDefined & rOther.mIsDefined);
308 virtual std::string
Info()
const
310 std::stringstream buffer;
325 for(std::size_t
i =
sizeof(
BlockType) * 8 ;
i > 0 ;
i--)
326 rOStream <<
bool(mFlags & (
BlockType(1) <<
i));
395 BlockType mIsDefined;
412 void SetDefined(
const BlockType& rDefined);
423 virtual void save(
Serializer& rSerializer)
const;
441 mIsDefined(DefinedFlags), mFlags(SetFlags)
std::size_t IndexType
Definition: flags.h:74
void Flip(const Flags ThisFlag)
Definition: flags.h:199
Flags AsFalse() const
Definition: flags.h:241
bool IsDefined(Flags const &rOther) const
Definition: flags.h:279
void ClearPosition(IndexType Position)
Definition: flags.h:228
bool Is(Flags const &rOther) const
Definition: flags.h:274
int64_t FlagType
Definition: flags.h:72
virtual std::string Info() const
Turn back information as a string.
Definition: flags.h:308
void Reset(const Flags ThisFlag)
Definition: flags.h:193
FlagsList
Definition: flags.h:77
void FlipPosition(IndexType Position)
Definition: flags.h:221
static Flags Create(IndexType ThisPosition, bool Value=true)
Definition: flags.h:138
static const Flags AllTrue()
Definition: flags.h:257
Flags operator~() const
Definition: flags.h:164
Flags(Flags const &rOther)
Copy constructor.
Definition: flags.h:122
static const Flags AllDefined()
Definition: flags.h:252
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: flags.h:322
int64_t BlockType
Definition: flags.h:70
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: flags.h:316
bool IsNot(Flags const &rOther) const
Definition: flags.h:291
Flags()
Default constructor.
Definition: flags.h:119
KRATOS_CLASS_POINTER_DEFINITION(Flags)
Pointer definition of Flags.
virtual ~Flags()
Destructor.
Definition: flags.h:136
bool GetPosition(IndexType Position) const
Definition: flags.h:215
Flags & operator=(Flags const &rOther)
Assignment operator.
Definition: flags.h:151
void SetPosition(IndexType Position, bool Value=true)
Definition: flags.h:205
bool operator!() const
Definition: flags.h:171
void Clear()
Definition: flags.h:235
bool IsNotDefined(Flags const &rOther) const
Definition: flags.h:296
void AssignFlags(Flags const &rOther)
Definition: flags.h:179
Wrapper for common MPI calls within Kratos.
Definition: mpi_data_communicator.h:182
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
#define KRATOS_API(...)
Definition: kratos_export_api.h:40
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
REACTION_CHECK_STIFFNESS_FACTOR INNER_LOOP_ITERATION DISTANCE_THRESHOLD ACTIVE_CHECK_FACTOR AUXILIAR_COORDINATES NORMAL_GAP WEIGHTED_GAP WEIGHTED_SCALAR_RESIDUAL bool
Definition: contact_structural_mechanics_application_variables.h:93
bool operator==(const Flags &Left, const Flags &Right)
Definition: flags.cpp:45
Flags operator&(const Flags &Left, const Flags &Right)
Definition: flags.cpp:62
Flags operator|(const Flags &Left, const Flags &Right)
Definition: flags.cpp:55
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
bool operator!=(const Flags &Left, const Flags &Right)
Definition: flags.cpp:50
flags
Definition: mpi_module_init.py:6
def load(f)
Definition: ode_solve.py:307
integer i
Definition: TensorModule.f:17