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_;
84 enum class Change { Null, AddToList, RemoveFromList, Active };
99 const IZone *zone_=
nullptr;
136 virtual FaceID getFaceID(uint32 side)
const=0;
224 enum class StrainMode { ShearRate=1, ShearInc=2, VolRate=3, VolInc=4, FullRate=5, FullInc=6, FullRotRate=7, FullRotInc=8 };
226 virtual SymTensor getTetStrainRate(
int overlay,
int number)
const=0;
227 virtual SymTensor getTetStrainIncrement(
int overlay,
int number)
const=0;
228 virtual SymTensor getStrainRate()
const=0;
229 virtual SymTensor getStrainIncrement()
const=0;
234 virtual string getCheckGeom()
const = 0;
247 virtual bool isNull()
const=0;
248 virtual bool isMechActive()
const=0;
249 virtual bool isFluidActive()
const=0;
250 virtual bool isThermActive()
const=0;
264 virtual double getQualityTest(
int iTestNum)
const=0;
266 virtual double getPlanarity()
const=0;
278 virtual bool getBadZoneExtruder()
const=0;
294 virtual double getVolume()
const=0;
308 virtual uint32
getAvgState(
int *piNum,
bool bAvgKeyword,
bool noPast=
false)
const=0;
350 virtual void setBit(
int bit,
bool b)
const=0;
357 virtual void setValue(
int index,
const QVariant &v)
const=0;
379 virtual bool fishIO(
bool save,fish::File *pnt)=0;
411 virtual string getFluidModel()
const=0;
416 virtual int getFluidPropIndex(
const string &name)
const=0;
430 virtual uint32 getThermPropIndex(
const string &name)
const=0;
452 virtual bool isInZn(
const DVect &dv,
const double &relTol=1.0e-5,
bool use2=
false)
const=0;
453 virtual bool checkZoneForPlot(
bool removeHidden,
bool showSelected,
bool hideNull)
const=0;
457 bool internalFaces_ =
false;
459 bool zoneFace_ =
false;
460 bool onlySelectedFaces_ =
false;
463 bool selected_ =
false;
469 virtual bool checkFaceForPlotFace(uint32 side,uint64 *
id,
FArray<DVect> *vertices,
bool excludeSelected=
true)
const=0;
470 virtual bool checkFaceForPlotFaceSelected(uint32 side,uint64 *
id,
FArray<DVect> *vertices)
const=0;
471 virtual void fillZoneVertices(
FArray<DVect> *vertices)
const=0;
472 virtual void fillAllZoneFaces(
FArray<
FArray<DVect>> *allVertices,
bool *selected,uint64 *
id)
const=0;
473 virtual int findFaceNormal(
const DVect &v)
const=0;
474 virtual double getMultiplier()
const=0;
475 virtual bool CMSupportsHysDamp()
const {
return false;} ;
477 static const char *unassignedModelName() {
return "unassigned"; }
480 inline size_t FaceID::hash(
const FaceID& fid) {
481 size_t ret = std::hash<uint64>()(fid.id_[0]);
482 for (uint32 i = 1; i<size(); ++i)
483 ret ^= std::hash<uint64>()(fid.id_[i]);
487 inline uint32 FaceID::replace(uint64 oldID, uint64 newID) {
489 for (uint32 i = 0; i<size();++i) {
501 void FaceID::sort() {
503 std::swap(id_[0], id_[1]);
506 std::swap(id_[2], id_[1]);
508 std::swap(id_[0], id_[1]);
511 std::swap(id_[3], id_[2]);
513 std::swap(id_[2], id_[1]);
515 std::swap(id_[0], id_[1]);
522 template <>
struct hash<zone::FaceID> {
523 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:89
A symmetric 2nd order tensor.
Definition symtensor.h:22
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:56
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 const IDynZone * getIDynZone() const =0
Returns a const pointer to the interface to access dynamic zone data.
virtual base::Property getProperty(const string &sc) const =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 double getAvgPP() const =0
Retrieves the average of the zone gridpoints pore pressures.
virtual void getTetGridPoints(int iOverlay, int iTet, IGp *gplist[])=0
virtual bool fishIO(bool save, fish::File *pnt)=0
virtual string getThermModel(bool exception) const =0
Returns the name of the zone thermal model.
virtual uint32 getNumGp() const =0
Returns the number of gridpoints used by the zone.
virtual const IZone * getNext() const =0
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 void setThermProp(const string &name, const base::Property &prop)=0
Sets the values of a given a thermal property name.
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 void setFluidProp(const string &name, const base::Property &val)=0
Sets the values of a given a fluid property name.
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 const IFluidZone * getIFluidZone() const =0
Returns a const pointer to the interface to access fluid zone data.
virtual IFluidZone * getIFluidZone()=0
Returns a pointer to the interface to access fluid zone data.
virtual base::Property getFluidProp(const string &name, bool exception) const =0
Given a fluid property name, returns its value;.
virtual IHysDamp * getHysDamp()=0
Returns a const pointer to the Hysteretic Damping model, IHysDamp, or null if the zone does not suppo...
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 void setValue(int index, const QVariant &v) 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.
IThing * getIThing() override=0
returns a IThing pointer
Code
Possible Zone types code.
Definition izone.h:86
StrainMode
Definition izone.h:224
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 dry density.
const IThing * getIThing() const override=0
returns a const IThing pointer
virtual void setModelName(const string &qs, bool updateFlags=true)=0
virtual const IGp * getGp(uint32 index) const =0
virtual double getAvgTemp() const =0
Retrieves the average of the zone gridpoints temperatures.
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 StringList getFluidProperties() const =0
Returns the list of properties for the fluid model.
virtual bool addFaceGroup(uint32 side, const IGroupID &group)=0
virtual double getVolumeTest() const =0
Performs an volume test on the zone.
virtual const IZone * getLinkZone(uint32 index) const =0
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 double getAspectTest() const =0
virtual std::vector< uint32 > getFaceExtraIndices(uint32 side) const =0
virtual double getWPShear() const =0
Returns the total shear plastic work dissipated, see SET ENERGY command.
static const TType type_
The type identification number for this class, for use in convert_cast() and convert_getcast().
Definition izone.h:83
virtual DVect getCentroid() const =0
Returns the location of the centroid of the zone.
virtual double getWetDensity() const =0
Returns the zone wet density.
virtual uint32 getFaceGroupList(uint32 side, FArray< IGroupID > *list) const =0
Return all groups and all slots assigned to the face in a list.
virtual IThermZone * getIThermZone()=0
returns a pointer to the zone thermal extension data
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 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 IThermZone * getIThermZone() const =0
returns a constant pointer to the zone thermal extension 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 zone fluid density.
virtual void setWPShear(const double &dwps)=0
Sets the total shear plastic work dissipated, see SET ENERGY command.
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 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 const IGp * getFaceGp(uint32 face, uint32 index) const =0
virtual IZone * getLinkZone(uint32 index)=0
virtual bool getFaceHidden(uint32 side) const =0
Returns TRUE if that face of the zone is marked as hidden.
virtual string getIsDegenerate() const =0
Returns non-empty string if the zone is degenerate.
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 IDynZone * getIDynZone()=0
Returns a pointer to the interface to access dynamic zone data.
virtual base::Property getThermProp(const string &name, bool exception) const =0
Given a thermal property name, returns its value;.
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 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 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 string getStateName(uint32 bit) const =0
virtual const IZone * getJoin(uint32 face) 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 IZone * getNext()=0
virtual void setDensity(const double &d)=0
Sets the zone density.
virtual ITet * getOverlay(uint32 ov)=0
Returns a pointer to the head of the list of tetrahedron, Itet, comprising the first overlay.
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 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
DVect3 DVect
Vector of doubles, either 2D or 3D.
Definition dim.h:154
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:199
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