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;
65 virtual void zeroInitialGeneralizedStrains(
void);
69 inline PhysProp &getPhysicalProperties(
void)
71 inline const PhysProp &getPhysicalProperties(
void)
const 73 void setPhysicalProperties(
const PhysProp &);
75 {
return physicalProperties.getMaterialNames(); }
83 boost::python::list
getValuesAtNodes(
const std::string &,
bool silent=
false)
const;
86 template <
int NNODOS,
class PhysProp>
90 template <
int NNODOS,
class PhysProp>
91 ElemWithMaterial<NNODOS,PhysProp>::ElemWithMaterial(
int tag,
int classTag,
const PhysProp &physProp)
95 template <
int NNODOS,
class PhysProp>
101 const material_type *tmp=
dynamic_cast<const material_type *
>(ptr_mat);
108 std::cerr << this->
getClassName() <<
"::" << __FUNCTION__ <<
"; " 109 <<
"material with tag: " << ptr_mat->
getTag()
111 <<
"' is not a suitable material.\n";
117 template <
int NNODOS,
class PhysProp>
122 template <
int NNODOS,
class PhysProp>
129 std::cerr << this->
getClassName() <<
"::" << __FUNCTION__
131 <<
"material identified by: '" << matName
132 <<
"' is not a suitable material.\n";
137 template <
int NNODOS,
class PhysProp>
144 template <
int NNODOS,
class PhysProp>
150 std::cerr << this->
getClassName() <<
"::" << __FUNCTION__
151 <<
"; failed in base class." << std::endl;
158 template <
int NNODOS,
class PhysProp>
167 template <
int NNODOS,
class PhysProp>
175 template <
int NNODOS,
class PhysProp>
181 template <
int NNODOS,
class PhysProp>
187 template <
int NNODOS,
class PhysProp>
190 std::cerr << this->
getClassName() <<
"::" << __FUNCTION__
191 <<
"; must be overloaded in derived classes." 193 static const Matrix retval;
198 template <
int NNODOS,
class PhysProp>
213 template <
int NNODOS,
class PhysProp>
216 boost::python::list retval;
221 const size_t nRows= nodeValues.
noRows();
222 for(
size_t i= 0;i<nRows;i++)
225 retval.append(valueAtNode);
234 template <
int NNODOS,
class PhysProp>
243 template <
int NNODOS,
class PhysProp>
252 template <
int NNODOS,
class PhysProp>
258 else if(responseID == 2)
260 else if(responseID == 3)
262 else if(responseID == 4)
268 template <
int NNODOS,
class PhysProp>
272 if(argv[0] ==
"force" || argv[0] ==
"forces")
274 else if(argv[0] ==
"stiff" || argv[0] ==
"stiffness")
276 else if(argv[0] ==
"material" || (argv[0]==
"Material") || argv[0] ==
"integrPoint")
278 size_t pointNum = atoi(argv[1]);
280 retval= this->setMaterialResponse(this->
physicalProperties[pointNum-1],argv,2,eleInfo);
284 else if(argv[0] ==
"stress" || argv[0] ==
"stresses")
286 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:1077
int revertToStart(void)
Reverts the element to its initial state.
Definition: ElemWithMaterial.h:168
virtual int revertToStart(void)
Reverts the element to its initial state.
Definition: Element.cpp:148
Float vector abstraction.
Definition: Vector.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:74
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:138
virtual const Matrix & getExtrapolationMatrix(void) const
Return the matrix that extrapolates results at material points to results at nodes.
Definition: ElemWithMaterial.h:188
void setMaterial(const Material &)
Set the element material.
Definition: ElemWithMaterial.h:118
int commitState(void)
Commit the current element state.
Definition: ElemWithMaterial.h:145
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:214
Base class for materials.
Definition: Material.h:93
int sendData(Communicator &)
Send members through the communicator argument.
Definition: ElemWithMaterial.h:235
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:244
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:199
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:253
bool set_material_ptr(const Material *)
Set the element material.
Definition: ElemWithMaterial.h:96
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:170
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:1602
int getTag(void) const
Returns the tag associated with the object.
Definition: TaggedObject.h:119
Base class for finite element with pointer to nodes container.
Definition: ElementBase.h:48
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:269
int revertToLastCommit(void)
Revert to the last committed state.
Definition: ElemWithMaterial.h:159
int recvData(const Communicator &comm)
Receives members through the communicator argument.
Definition: ElementBase.h:179