30 #ifndef ElemWithMaterial_h 31 #define ElemWithMaterial_h 33 #include "ElementBase.h" 34 #include "domain/mesh/element/utils/Information.h" 35 #include "utility/recorder/response/ElementResponse.h" 37 #include "preprocessor/Preprocessor.h" 38 #include "preprocessor/prep_handlers/MaterialHandler.h" 44 template <
int NNODOS,
class PhysProp>
48 typedef typename PhysProp::material_type material_type;
64 virtual void zeroInitialGeneralizedStrains(
void);
67 inline PhysProp &getPhysicalProperties(
void)
69 inline const PhysProp &getPhysicalProperties(
void)
const 71 void setPhysicalProperties(
const PhysProp &);
73 {
return physicalProperties.getMaterialNames(); }
81 boost::python::list
getValuesAtNodes(
const std::string &,
bool silent=
false)
const;
84 template <
int NNODOS,
class PhysProp>
88 template <
int NNODOS,
class PhysProp>
89 ElemWithMaterial<NNODOS,PhysProp>::ElemWithMaterial(
int tag,
int classTag,
const PhysProp &physProp)
93 template <
int NNODOS,
class PhysProp>
99 const material_type *tmp=
dynamic_cast<const material_type *
>(ptr_mat);
103 std::cerr << this->
getClassName() <<
"::" << __FUNCTION__ <<
"; " 104 <<
"material identified by: '" << matName
105 <<
"' is not a suitable material.\n";
110 template <
int NNODOS,
class PhysProp>
117 template <
int NNODOS,
class PhysProp>
123 std::cerr << this->
getClassName() <<
"::" << __FUNCTION__
124 <<
"; failed in base class." << std::endl;
131 template <
int NNODOS,
class PhysProp>
140 template <
int NNODOS,
class PhysProp>
148 template <
int NNODOS,
class PhysProp>
154 template <
int NNODOS,
class PhysProp>
160 template <
int NNODOS,
class PhysProp>
163 std::cerr << this->
getClassName() <<
"::" << __FUNCTION__
164 <<
"; must be overloaded in derived classes." 166 static const Matrix retval;
171 template <
int NNODOS,
class PhysProp>
186 template <
int NNODOS,
class PhysProp>
189 boost::python::list retval;
194 const size_t nRows= nodeValues.
noRows();
195 for(
size_t i= 0;i<nRows;i++)
198 retval.append(valueAtNode);
207 template <
int NNODOS,
class PhysProp>
216 template <
int NNODOS,
class PhysProp>
225 template <
int NNODOS,
class PhysProp>
231 else if(responseID == 2)
233 else if(responseID == 3)
235 else if(responseID == 4)
241 template <
int NNODOS,
class PhysProp>
245 if(argv[0] ==
"force" || argv[0] ==
"forces")
247 else if(argv[0] ==
"stiff" || argv[0] ==
"stiffness")
249 else if(argv[0] ==
"material" || (argv[0]==
"Material") || argv[0] ==
"integrPoint")
251 size_t pointNum = atoi(argv[1]);
253 retval= this->setMaterialResponse(this->
physicalProperties[pointNum-1],argv,2,eleInfo);
257 else if(argv[0] ==
"stress" || argv[0] ==
"stresses")
259 else if(argv[0] ==
"strain" || argv[0] ==
"strains")
int sendMovable(MovableObject &, DbTagData &, const CommMetaData &)
Sends a movable object through the communicator argument.
Definition: Communicator.cc:1163
const Material * get_material_ptr(const std::string &) const
Return a pointer to the material that corresponds to the name.
Definition: Element.cpp:1024
int revertToStart(void)
Reverts the element to its initial state.
Definition: ElemWithMaterial.h:141
virtual int revertToStart(void)
Reverts the element to its initial state.
Definition: Element.cpp:148
Float vector abstraction.
Definition: Vector.h:94
void setMaterial(const std::string &)
Set the element material.
Definition: ElemWithMaterial.h:94
Communication parameters between processes.
Definition: Communicator.h:66
Base class response objects.
Definition: Response.h:81
virtual std::set< std::string > getMaterialNames(void) const
Return the names of the material(s) of the element.
Definition: ElemWithMaterial.h:72
virtual const Vector & getResistingForce(void) const =0
Returns the resisting force vector for the element.
void copyMaterialFrom(const ElemWithMaterial &, bool reverToStart=true)
Copy the material from the given element.
Definition: ElemWithMaterial.h:111
virtual const Matrix & getExtrapolationMatrix(void) const
Return the matrix that extrapolates results at material points to results at nodes.
Definition: ElemWithMaterial.h:161
int commitState(void)
Commit the current element state.
Definition: ElemWithMaterial.h:118
int receiveMovable(MovableObject &, DbTagData &, const CommMetaData &) const
Receives a movable object trhrough the communicator argument.
Definition: Communicator.cc:1174
boost::python::list getValuesAtNodes(const std::string &, bool silent=false) const
Return a python list with the values of the argument property at element nodes.
Definition: ElemWithMaterial.h:187
Base class for materials.
Definition: Material.h:93
int sendData(Communicator &)
Send members through the communicator argument.
Definition: ElemWithMaterial.h:208
virtual const Matrix & getTangentStiff(void) const =0
Return the tangent stiffness matrix.
PhysProp physicalProperties
pointers to the material objects and physical properties.
Definition: ElemWithMaterial.h:50
Response of an element.
Definition: ElementResponse.h:68
int recvData(const Communicator &)
Receives members through the communicator argument.
Definition: ElemWithMaterial.h:217
virtual DbTagData & getDbTagData(void) const
Returns a vector to store class dbTags.
Definition: DistributedBase.cc:43
virtual std::string getClassName(void) const
Returns demangled class name.
Definition: EntityWithOwner.cc:90
Matrix getExtrapolatedValues(const Matrix &) const
Extrapolate from Gauss points to nodes.
Definition: ElemWithMaterial.h:172
int noRows() const
Returns the number of rows, numRows, of the Matrix.
Definition: Matrix.h:269
int getResponse(int responseID, Information &eleInformation)
Obtain information from an analysis.
Definition: ElemWithMaterial.h:226
Vector getRow(int row) const
Return the row which index being passed as parameter.
Definition: Matrix.cpp:1101
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
int sendData(Communicator &comm)
Send members through the communicator argument.
Definition: ElementBase.h:145
virtual boost::python::list getValuesAtNodes(const std::string &, bool silent=false) const
Return a python list with the values of the argument property at element nodes.
Definition: Element.cpp:1463
Base class for finite element with pointer to nodes container.
Definition: ElementBase.h:47
Element with material.
Definition: ElemWithMaterial.h:45
Matrix of floats.
Definition: Matrix.h:111
Response * setResponse(const std::vector< std::string > &argv, Information &eleInformation)
element response.
Definition: ElemWithMaterial.h:242
int revertToLastCommit(void)
Revert to the last committed state.
Definition: ElemWithMaterial.h:132
int recvData(const Communicator &comm)
Receives members through the communicator argument.
Definition: ElementBase.h:154