10 #include "utility/interface/igroup.h"
13 #include "base/src/property.h"
24 class ConstitutiveModel;
34 static const uint32 ulNumZoneType =
dimval(2,5);
35 static const uint32 numTperOv_ =
dimval(2,5);
36 static const uint32 numGPperZ_ =
dimval(4,8);
37 static const uint32 numGPperT_ =
dimval(3,4);
38 static const uint32 numAdjZones_ =
dimval(4,6);
39 static const uint32 numFacesZ_ =
dimval(4,6);
40 static const uint32 numGPperFace_ =
dimval(2,4);
41 static const uint32 minGPperFace_ =
dimval(2,3);
42 static const uint32 numEdgeZ_ =
dimval(4,12);
57 static constexpr uint32 size() {
return numGPperFace_; }
59 FaceID() { std::fill(id_.begin(), id_.end(), 0); }
61 FaceID(
const std::array<uint64, numGPperFace_>&
id) : id_(
id) { sort(); }
63 inline const FaceID& operator=(
const FaceID&
id) { id_ =
id.id_;
return *
this; }
64 inline bool operator==(
const FaceID &
id)
const {
return id_==
id.id_; }
65 inline bool operator!=(
const FaceID &
id)
const {
return !operator==(
id); }
66 inline bool operator<(
const FaceID&
id)
const {
return id_<
id.id_; }
67 inline uint64 &operator[](uint32 index) {
return id_[index]; }
68 inline const uint64 &operator[](uint32 index)
const {
return id_[index]; }
69 inline uint32 replace(uint64 oldID, uint64 newID);
72 static inline size_t hash(
const FaceID &fid);
75 std::array<uint64, numGPperFace_> id_;
83 inline static const TType type_ = 0x4c815bf8;
84 enum class Change { MechNull, AddToList, RemoveFromList, FlNull, ThNull };
99 const IZone *zone_=
nullptr;
136 virtual FaceID getFaceID(uint32 side)
const=0;
230 enum class StrainMode { ShearRate=1, ShearInc=2, VolRate=3, VolInc=4, FullRate=5, FullInc=6, FullRotRate=7, FullRotInc=8 };
231 virtual double getSSR(StrainMode mode,SymTensor *fsr)
const=0;
232 virtual SymTensor getTetStrainRate(
int overlay,
int number)
const=0;
233 virtual SymTensor getTetStrainIncrement(
int overlay,
int number)
const=0;
234 virtual SymTensor getStrainRate()
const=0;
235 virtual SymTensor getStrainIncrement()
const=0;
240 virtual string getCheckGeom()
const = 0;
272 virtual double getQualityTest(
int iTestNum)
const=0;
274 virtual double getPlanarity()
const=0;
286 virtual bool getBadZoneExtruder()
const=0;
301 virtual double getVolume()
const=0;
315 virtual uint32
getAvgState(
int *piNum,
bool bAvgKeyword,
bool noPast=
false)
const=0;
357 virtual void setBit(
int bit,
bool b)
const=0;
364 virtual void setValue(
int index,
const QVariant &v)
const=0;
386 virtual bool fishIO(
bool save,fish::File *pnt)=0;
426 virtual double getFluidProp(
const string &name,
bool exception=
true)
const =0;
427 virtual int getFluidPropIndex(
const string &name)
const=0;
428 virtual double getFluidProp(uint32 index)
const=0;
431 virtual void setFluidProp(
int index,
const double &val)=0;
440 virtual double getThermProp(
const string &name,
bool exception=
true)
const =0;
441 virtual int getThermPropIndex(
const string &name)
const=0;
442 virtual double getThermProp(uint32 index)
const=0;
445 virtual void setThermProp(
int index,
const double &val)=0;
462 virtual bool invalidZone(
bool mech=
true,
bool therm=
false,
bool fluid=
false,
bool orVal=
false)
const=0;
470 virtual bool isInZn(
const DVect &dv,
const double &relTol=1.0e-5,
bool use2=
false)
const=0;
471 virtual bool checkZoneForPlot(
bool removeHidden,
bool showSelected,
bool hideMech,
bool hideTherm,
bool hideFluid)
const=0;
475 bool internalFaces_ =
false;
477 bool zoneFace_ =
false;
478 bool onlySelectedFaces_ =
false;
481 bool selected_ =
false;
487 virtual bool checkFaceForPlotFace(uint32 side,uint64 *
id,
FArray<DVect> *vertices,
bool excludeSelected=
true)
const=0;
488 virtual bool checkFaceForPlotFaceSelected(uint32 side,uint64 *
id,
FArray<DVect> *vertices)
const=0;
489 virtual void fillZoneVertices(
FArray<DVect> *vertices)
const=0;
490 virtual void fillAllZoneFaces(
FArray<
FArray<DVect>> *allVertices,
bool *selected,uint64 *
id)
const=0;
491 virtual int findFaceNormal(
const DVect &v)
const=0;
492 virtual double getMultiplier()
const=0;
493 virtual bool CMSupportsHysDamp()
const {
return false;} ;
496 inline size_t FaceID::hash(
const FaceID& fid) {
497 size_t ret = std::hash<uint64>()(fid.id_[0]);
498 for (uint32 i = 1; i<size(); ++i)
499 ret ^= std::hash<uint64>()(fid.id_[i]);
503 inline uint32 FaceID::replace(uint64 oldID, uint64 newID) {
505 for (uint32 i = 0; i<size();++i) {
517 void FaceID::sort() {
519 std::swap(id_[0], id_[1]);
522 std::swap(id_[2], id_[1]);
524 std::swap(id_[0], id_[1]);
527 std::swap(id_[3], id_[2]);
529 std::swap(id_[2], id_[1]);
531 std::swap(id_[0], id_[1]);
538 template <>
struct hash<zone::FaceID> {
539 size_t operator()(
const zone::FaceID& fid)
const {
return zone::FaceID::hash(fid); }
An array class that attempts to minimize unnecessary heap access.
Definition: farray.h:25
Definition: basestring.h:77
Definition: property.h:20
Definition: iparameter.h:13
Interface to a group object.
Definition: igroup.h:9
Base class for items that will be stored in containers.
Definition: ithing.h:30
Interface to a filter, used as the main method for filtering objects.
Definition: irange.h:32
The base class for constitutive model plug-ins.
Definition: conmodel.h:32
Generic base class for the zone interface made available to the constitutive model system.
Definition: igenericzone.h:23
Interface to access dynamic zone data.
Definition: idynzone.h:12
Interface to access fluid zone data.
Definition: ifluidzone.h:12
Interface to provide access to a gridpoint.
Definition: igp.h:55
Interface to hysteretic damping.
Definition: ihysdamp.h:13
Interface to one of the tetrahedra used to implement mixed-discretization in a zone.
Definition: itet.h:26
Interface to access zone thermal data.
Definition: ithermzone.h:14
Interface to provide access to a zone.
Definition: izone.h:80
virtual int getNumTets() const =0
Returns the number of tetrahedrons in the zone.
virtual double getFluidDensity() const =0
Returns the zone fluid density.
virtual base::Property getProperty(const string &sc) const =0
virtual string getThermModel(bool exception=true) const =0
Returns the name of the zone thermal model.
virtual void setFluidProp(const string &name, const double &val)=0
Sets the values of a given a fluid property name.
virtual const IThermZone * getIThermZone() const =0
returns a constant pointer to the zone thermal extension data
virtual const IGroup * getFaceGroup(uint32 side, const ISlotID &slot=ISlotID((uint32) 0)) const =0
Given a face side and a group slot, returns a const pointer to an IGroup.
virtual void getTetGridPoints(int iOverlay, int iTet, IGp *gplist[])=0
virtual bool fishIO(bool save, fish::File *pnt)=0
virtual const IHysDamp * getHysDamp() const =0
Returns a const pointer to the Hysteretic Damping model, IHysDamp, or null if the zone does not suppo...
virtual uint32 getNumGp() const =0
Returns the number of gridpoints used by the zone.
virtual uint32 getEdgeGpIndex(uint32 edge, uint32 index) const =0
virtual double getWPTotal() const =0
Returns the total shear plastic work dissipated (sum of getWPVol() and getWPShear()),...
virtual DVect getFlowVector() const =0
Returns the flow vector.
virtual bool getFaceSelected(uint32 side) const =0
Returns TRUE if that face of the zone is marked as selected.
virtual IZone * getNext()=0
virtual bool setFaceHidden(uint32 side, bool b)=0
Sets the hidden condition of that face of the zone, returns true if the condition changed.
virtual double getZoneCondition(int i=0) const =0
Returns the condition of zone geometry.
virtual double getVolumeD(bool deformed) const =0
virtual bool setProperty(const string &sc, const base::Property &v)=0
virtual StringList getThermProperties() const =0
Returns the list of properties for the thermal model.
virtual string getModelName() const =0
Returns the name of the mechanical constitutive model present in the zone.
virtual StringList getPropertyNames() const =0
returns a list of all the valid properties of the current constitutive model assigned to this zone
virtual double getAspectTetTest() const =0
virtual const fish::IParameter * getFaceExtra(uint32 side, uint32 index) const =0
Given an index, returns a const pointer to IFishParam associated with this face side.
virtual uint32 getFaceGpIndex(uint32 face, uint32 index) const =0
virtual int initializeModels()=0
Initialize all active models (Fluid, Thermal and mechanical). Returns 0 upon completion.
virtual void setBit(int bit, bool b) const =0
virtual void setState(uint32 state)=0
virtual bool isFaceInRange(uint32 side, const IRange *range) const =0
Returns TRUE if the FACE is considered in the range. Creates a temp Face class.
virtual uint32 getNumFace() const =0
Returns the number of faces used by the zone.
virtual void setThermProp(const string &name, const double &val)=0
Sets the values of a given a thermal property name.
virtual bool getHasALiveThermModel() const =0
Returns true if the zone contains a non-null thermal model.
virtual IDynZone * getIDynZone()=0
Returns a pointer to the interface to access dynamic zone data.
virtual bool getBit(int bit) const =0
virtual double getWEShear() const =0
Returns the total shear elastic work, see SET ENERGY command.
virtual string getSupports2Overlays() const =0
Returns true if the Zone supports two overlays.
virtual bool isMechanicalNull() const =0
Returns true if the Mechanical model in the zone is null, returns \ b false otherwise.
virtual void setValue(int index, const QVariant &v) const =0
virtual const IZone * getLinkZone(uint32 index) const =0
virtual uint32 getAvgState(int *piNum, bool bAvgKeyword, bool noPast=false) const =0
Returns a mask filled with a state indicator for the zone.
virtual string getFlowModel() const =0
Returns the name of the fluid flow model used by the Zone, or "undefined" if the zone has not been co...
Code
Possible Zone types code.
Definition: izone.h:86
StrainMode
Definition: izone.h:230
virtual bool removeFaceGroup(uint32 side, const IGroupID &group)=0
Removes the association of a given group with face side.
virtual void setWEVol(const double &dwpv)=0
Sets the total volumetric elastic work, see SET ENERGY command.
virtual double getDensity() const =0
Returns the zone density.
virtual const IZone * getNext() const =0
virtual bool getHasALiveFluidModel() const =0
Returns true if the zone contains a non-null fluid model.
virtual double getAvgTemp() const =0
Retrieves the average of the zone gridpoints temperatures.
virtual double getFluidProp(const string &name, bool exception=true) const =0
Given a fluid property name, returns its value;.
virtual bool isFluidNull() const =0
Returns true if the Fluid model in the zone is null, returns \ b false otherwise.
virtual StringList getFluidProperties() const =0
Returns the list of properties for the fluid model.
virtual bool addFaceGroup(uint32 side, const IGroupID &group)=0
virtual const IZone * getJoin(uint32 face) const =0
virtual double getVolumeTest() const =0
Performs an volume test on the zone.
virtual ITet * getOverlay(uint32 ov)=0
Returns a pointer to the head of the list of tetrahedron, Itet, comprising the first overlay.
const IThing * getIThing() const override=0
returns a const IThing pointer
virtual double getAspectTest() const =0
virtual const IGp * getFaceGp(uint32 face, uint32 index) const =0
IThing * getIThing() override=0
returns a IThing pointer
virtual bool isThermalNull() const =0
Returns true if the Thermal model in the zone is null, returns \ b false otherwise.
virtual void setModelName(const string &qs)=0
virtual double getWPShear() const =0
Returns the total shear plastic work dissipated, see SET ENERGY command.
virtual DVect getCentroid() const =0
Returns the location of the centroid of the zone.
virtual uint32 getFaceGroupList(uint32 side, FArray< IGroupID > *list) const =0
Return all groups and all slots assigned to the face in a list.
virtual DVect getFaceCentroid(uint32 face) const =0
virtual int getFace(const FaceID &fid) const =0
virtual DVect getFaceNormal(uint32 face, bool normalize) const =0
virtual uint32 getPropertyIndex(const string &sc) const =0
virtual IFluidZone * getIFluidZone()=0
Returns a pointer to the interface to access fluid zone data.
virtual void copyFaceGroups(uint32 side, const IThing *t)=0
Copy the groups in IThing object to face /side.
virtual bool setFaceSelected(uint32 side, bool b)=0
sets the selected condition of that face of the zone, returns true if the condition chagned.
virtual const IDynZone * getIDynZone() const =0
Returns a const pointer to the interface to access dynamic zone data.
virtual void copyState(const IZone *zone)=0
Copies the state information from zone zone to the current zone.
virtual Code getCode() const =0
Returns the Code corresponding the the Zone type, see the Code enumeration.
virtual void setWPShear(const double &dwps)=0
Sets the total shear plastic work dissipated, see SET ENERGY command.
virtual const IFluidZone * getIFluidZone() const =0
Returns a const pointer to the interface to access fluid zone data.
virtual void setThermModel(const string &name)=0
virtual uint32 isFaceInGroup(uint32 side, const FArray< IGroupID > &ids, TType type=0, bool only=false) const =0
virtual IHysDamp * getHysDamp()=0
Returns a const pointer to the Hysteretic Damping model, IHysDamp, or null if the zone does not suppo...
virtual double getThermProp(const string &name, bool exception=true) const =0
Given a thermal property name, returns its value;.
virtual double getWPVol() const =0
Returns the total volumetric plastic work dissipated, see SET ENERGY command.
virtual void setStress(const SymTensor &sym)=0
Assign the stress state in sym to the zone, overwriting every overlay tetrahedron.
virtual bool getHasALiveMechModel() const =0
Returns true if the zone contains a non-null mechanical constitutive model.
virtual string getFluidModel(bool exception=true) const =0
Returns the name of the zone fluid model.
virtual IZone * getLinkZone(uint32 index)=0
virtual const ITet * getOverlay(uint32 ov) const =0
Returns a const pointer to the head of the list of tetrahedron, Itet, comprising the first overlay.
virtual bool getFaceHidden(uint32 side) const =0
Returns TRUE if that face of the zone is marked as hidden.
virtual const IGp * getGp(uint32 index) const =0
virtual string getIsDegenerate() const =0
Returns non-empty string if the zone is degenerate.
virtual bool invalidZone(bool mech=true, bool therm=false, bool fluid=false, bool orVal=false) const =0
virtual void setWEShear(const double &dwps)=0
Sets the total shear elastic work, see SET ENERGY command.
virtual QString getFaceGroupName(uint32 side, const ISlotID &slot=ISlotID()) const =0
virtual void setStress(const double &val, uint32 pn)=0
virtual void setWPVol(const double &dwpv)=0
Sets the total volumetric plastic work dissipated, see SET ENERGY command.
virtual double getOrthoTest() const =0
Performs an orthogonality test on the zone.
virtual uint32 getFaceExtraSize(uint32 side) const =0
virtual IThermZone * getIThermZone()=0
returns a pointer to the zone thermal extension data
virtual void setFaceExtra(uint32 side, uint32 index, const fish::IParameter &p)=0
virtual SymTensor getAveStress(bool effective=false) const =0
Computes the average of the overlays tetrahedron stress tensors.
virtual double getStrengthStressRatio(const SymTensor &s) const =0
virtual uint32 getFaceSize(uint32 face) const =0
virtual double getWEVol() const =0
Returns the total volumetric elastic work, see SET ENERGY command.
virtual void setFluidModel(const string &name)=0
virtual string getStateName(uint32 bit) const =0
virtual double getSmallestNormalizedTetVolume(bool deformed=false) const =0
Return the volume of the smallest tetrahedron in the overlays, normalized to the zone volume.
virtual QVariant getValue(int index) const =0
virtual void setDensity(const double &d)=0
Sets the zone density.
virtual uint32 getLinkIndex(uint32 index) const =0
virtual string getPropertyName(uint32 index) const =0
virtual DVect getThermalFlux() const =0
Returns the thermal flux vector in the Zone, or a null vector if the zone has not been configured for...
virtual double getAvePP() const =0
Retrieves the average of the zone gridpoints pore pressures.
virtual bool isInZn(const DVect &dv, const double &relTol=1.0e-5, bool use2=false) const =0
virtual double getWETotal() const =0
Returns the total elastic work (sum of getWEVol() and getWEShear()), see SET ENERGY command.
DIM - Provides code portability between 2D and 3D codes.
An array class that attempts to minimize unnecessary heap access.
uint32 TType
class type indicator
Definition: basedef.h:46
constexpr const U & dimval(const T &, const U &val3)
Returns the first argument in a 2D compile, and the second in a 3D compile.
Definition: dim.h:190
DVect3 DVect
Vector of doubles, either 2D or 3D.
Definition: dim.h:150
Generic base class for the zone interface made available to the constitutive model system.
namespace Itasca
Definition: basememory.cpp:10
Itasca Library standard namespace, specific to 2D or 3D.
Definition: icontactmodule.h:4
The Constitutive Model interface library.
Definition: conmodel.cpp:7