1 #include <pybind11/pybind11.h> 2 #include <pybind11/operators.h> 3 #include <pybind11/iostream.h> 4 #include <pybind11/stl.h> 5 #include <pybind11/stl_bind.h> 11 namespace py = pybind11;
87 PYBIND11_MAKE_OPAQUE(std::map<int,int>)
89 string
to_string(const
string &value) {
return value;}
94 static void declareTPZVec(py::module &mod, std::string
const &suffix) {
96 using PyClass = py::class_<Class, std::shared_ptr<Class>>;
98 PyClass cls(mod, (
"TPZVec" + suffix).c_str());
101 cls.def(py::init<int>());
102 cls.def(py::init<int64_t, T>());
103 cls.def(
"Resize", [](Class &vec,
const int64_t &newsize) {
return vec.Resize(newsize); });
104 cls.def(
"Size", [](
const Class &vec) {
return vec.size(); });
106 [](
const Class &vec) {
107 std::string r(
"TPZVec [");
109 for (
int i = 1; i < vec.NElements(); i++) {
118 cls.def(
"__getitem__",
119 [](
const Class &vec, int64_t position) {
120 if (position >= vec.size() || position < 0)
throw py::index_error();
121 return vec[position];
125 cls.def(
"__setitem__",
126 [](Class &vec, int64_t position, T value) {
127 if (position >= vec.size() || position < 0)
throw py::index_error();
128 vec[position] = value;
136 template <
typename T>
137 static void declareTPZManVector(py::module & mod, std::string
const & suffix) {
139 using PyClass = py::class_<Class, std::shared_ptr<Class>,
TPZVec<T> >;
141 PyClass cls(mod, (
"TPZManVector" + suffix).c_str());
144 cls.def(py::init<int>());
145 cls.def(py::init<int64_t, T>());
146 cls.def(
"Resize", [](Class & vec,
const int64_t& newsize) {
return vec.Resize(newsize); });
147 cls.def(
"Size", [](
const Class & vec) {
return vec.size(); });
149 [](
const Class & vec) {
150 std::string r(
"TPZManVector [");
152 for (
int i = 1; i < vec.NElements(); i++) {
161 cls.def(
"__getitem__",
162 [](
const Class & vec, int64_t position) {
163 if (position >= vec.size() || position < 0)
throw py::index_error();
164 return vec[position];
168 cls.def(
"__setitem__",
169 [](Class & vec, int64_t position, T value) {
170 if (position >= vec.size() || position < 0)
throw py::index_error();
171 vec[position] = value;
178 template <
typename T>
179 static void declareTPZStack(py::module & mod, std::string
const & suffix) {
181 using PyClass = py::class_<Class, std::shared_ptr<Class>>;
183 PyClass cls(mod, (
"TPZStack" + suffix).c_str());
186 cls.def(py::init<int, T>());
187 cls.def(
"Push", [](Class & stack, T
object) {
190 cls.def(
"Pop", [](Class & stack) {
193 cls.def(
"Peek", [](Class & stack) {
197 [](
const Class & stack) {
198 std::string r(
"TPZStack [");
199 for (
int i = 0; i < stack.NElements(); i++) {
201 if (i != stack.NElements() - 1) {
215 ------------------------- 216 Python bindings for NeoPZ 217 ------------------------- 222 declareTPZVec<int>(
m,
"_int");
223 declareTPZVec<int64_t>(
m,
"_int64_t");
224 declareTPZVec<double>(
m,
"_double");
225 declareTPZVec<std::string>(
m,
"_string");
227 declareTPZManVector<int>(
m,
"_int");
228 declareTPZManVector<int64_t>(
m,
"_int64_t");
229 declareTPZManVector<double>(
m,
"_double");
230 declareTPZManVector<std::string>(
m,
"_string");
232 declareTPZStack<int>(
m,
"_int");
233 declareTPZStack<int64_t>(
m,
"_int64_t");
234 declareTPZStack<double>(
m,
"_double");
235 declareTPZStack<std::string>(
m,
"_string");
238 py::class_<TPZFMatrix<double>>(
m,
"TPZFMatrix")
240 .def(py::init<int64_t, int64_t>())
241 .def(py::init<int64_t, int64_t, double>())
243 if (row >= matrix.
Rows() || row < 0)
throw py::index_error();
244 if (col >= matrix.
Cols() || col < 0)
throw py::index_error();
245 return matrix.
GetVal(row, col);
249 if (rows >= mat.
Rows() || rows < 0)
throw py::index_error();
250 if (cols >= mat.
Cols() || cols < 0)
throw py::index_error();
251 mat(rows,cols) = value;
256 std::string r(
"TPZFMatrix ");
262 for (int64_t row = 0; row < matrix.
Rows(); row++) {
264 for (int64_t col = 0; col < matrix.
Cols(); col++) {
281 .def(py::self + py::self)
282 .def(py::self += py::self)
283 .def(py::self *=
float())
292 py::class_<TPZMatrix<double> >(
m,
"TPZMatrix")
297 std::ofstream printstream;
298 matrix.
Print(
"Matrix = ", printstream);
305 py::class_<TPZAdmChunkVector<TPZGeoNode>>(
m,
"TPZAdmChunkVectorNodes")
306 .def(py::init<int>())
311 if (position >= vec.
NElements() || position < 0)
throw py::index_error();
312 return vec[position];
319 py::class_<TPZTransform<double>>(
m,
"TPZTransform")
321 .def(py::init<int>())
322 .def(py::init<int, int>())
335 std::string r(
"TPZTransform\n");
342 for (int64_t row = 0; row < trans.
Mult().Rows(); row++) {
344 for (int64_t col = 0; col < trans.
Mult().Cols(); col++) {
357 for (int64_t row = 0; row < trans.
Sum().Rows(); row++) {
359 for (int64_t col = 0; col < trans.
Sum().Cols(); col++) {
372 py::class_<pztopology::TPZPoint>(
m,
"TPZPoint")
391 py::class_<pztopology::TPZLine>(
m,
"TPZLine")
415 py::class_<pztopology::TPZTriangle>(
m,
"TPZTriangle")
435 py::class_<pztopology::TPZQuadrilateral>(
m,
"TPZQuadrilateral")
454 py::class_<pztopology::TPZTetrahedron>(
m,
"TPZTetrahedron")
473 py::class_<pztopology::TPZPyramid>(
m,
"TPZPyramid")
492 py::class_<pztopology::TPZPrism>(
m,
"TPZPrism")
511 py::class_<pztopology::TPZCube>(
m,
"TPZCube")
530 py::class_<TPZGeoMesh>(
m,
"TPZGeoMesh")
545 std::ifstream file(filename);
547 map<set<int64_t> , int64_t> midnode;
551 int64_t nnodes, nvolumes;
552 file >> nnodes >> nvolumes;
553 elpartition.
Resize(nvolumes*6, -1);
557 for (int64_t in=0; in<nnodes; in++) {
559 for (
int i=0; i<3; i++) {
562 gmesh->
NodeVec()[in].Initialize(xco, *gmesh);
565 std::set<int64_t> badvolumes;
569 for (int64_t iv=0; iv<nvolumes; iv++) {
571 map<set<int64_t>,int64_t> nodepairs;
575 for (
int face = 0; face < nfaces; face++) {
580 for (
int i=0; i<elnnodes; i++) {
586 edge.insert(nodes[i-1]);
587 edge.insert(nodes[i]);
592 edge.insert(nodes[0]);
593 edge.insert(nodes[i]);
600 if (maxvol != -1 && iv >= maxvol) {
608 elpartition[index] = iv;
611 else if (elnnodes == 2)
616 elpartition[index] = iv;
619 else if (elnnodes == 3 || elnnodes == 4)
627 elpartition[index] = iv;
629 else if(elnnodes == 8)
633 elpartition[index] = iv;
636 else if(elnnodes > 4)
638 set<int64_t> elnodes;
640 for (
int i=0; i<elnnodes; i++) {
641 elnodes.insert(nodes[i]);
643 gmesh->
NodeVec()[nodes[i]].GetCoordinates(x);
645 for(
int j=0; j<3; j++) midxco[j] += x[j]/elnnodes;
647 int64_t midindex = -1;
648 if (midnode.find(elnodes) == midnode.end()) {
650 gmesh->
NodeVec()[midindex].Initialize(midxco, *gmesh);
651 midnode[elnodes] = midindex;
655 midindex = midnode[elnodes];
657 for (
int triangle = 0; triangle <elnnodes; triangle++) {
659 for (
int in=0; in<2; in++) {
660 nodeindices[in] = nodes[(triangle+in)%elnnodes];
662 nodeindices[2] = midindex;
665 elpartition[index] = iv;
674 bool suspicious =
false;
675 for (
auto it = nodepairs.begin(); it != nodepairs.end(); it++) {
676 if(it->second != 2) suspicious =
true;
678 if (suspicious ==
true) {
679 std::cout <<
"volume " << iv <<
" has no closure\n";
680 badvolumes.insert(iv);
691 int64_t nmidnodes = midnode.size();
693 scalingcenterindices.
Resize(nvolumes, -1);
694 for (int64_t in=0; in<nvolumes; in++) {
696 for (
int i=0; i<3; i++) {
699 gmesh->
NodeVec()[nnodes+nmidnodes+in].Initialize(xco, *gmesh);
700 scalingcenterindices[in] = nnodes+nmidnodes+in;
703 ofstream mirror(
"gmesh.vtk");
707 if (badvolumes.size()) {
710 for (int64_t el=0; el<nel; el++) {
711 if (badvolumes.find(elpartition[el]) != badvolumes.end()) {
716 ofstream badel(
"gmesh_bad.vtk");
722 std::cout <<
"Building element connectivity\n";
729 py::class_<TPZGeoNode>(
m,
"TPZGeoNode")
735 py::class_<TPZGeoEl, std::unique_ptr<TPZGeoEl, py::nodelete> >(
m,
"TPZGeoEl")
745 py::class_<TPZGeoElBC >(
m,
"TPZGeoElBC")
746 .def(py::init<TPZGeoEl*, int, int>())
750 py::class_<TPZGeoElSide, std::unique_ptr<TPZGeoElSide, py::nodelete> >(
m,
"TPZGeoElSide")
752 .def(py::init<TPZGeoEl*, int>())
757 py::class_<TPZGmshReader>(
m,
"TPZGmshReader")
764 py::class_<TPZMaterial, std::unique_ptr<TPZMaterial, py::nodelete>>(
m,
"TPZMaterial")
770 py::class_<TPZBndCond, TPZMaterial , std::unique_ptr<TPZBndCond, py::nodelete>>(
m,
"TPZBndCond")
772 .def(py::init<int>())
777 py::class_<TPZBndCondWithMem<TPZElastoPlasticMem>,
TPZBndCond, std::unique_ptr<TPZBndCondWithMem<TPZElastoPlasticMem>, py::nodelete>>(
m,
"TPZBndCondWithMem")
783 py::class_<TPZMatPoisson3d, TPZMaterial, std::unique_ptr<TPZMatPoisson3d, py::nodelete>>(
m,
"TPZMatPoisson3d")
784 .def(py::init<int, int>())
787 py::class_<TPZMatElastoPlastic< TPZPlasticStepPV<TPZYCMohrCoulombPV, TPZElasticResponse>,
TPZElastoPlasticMem >,
TPZMaterial, std::unique_ptr<TPZMatElastoPlastic< TPZPlasticStepPV<TPZYCMohrCoulombPV, TPZElasticResponse>, TPZElastoPlasticMem >, py::nodelete>>(
m,
"TPZMatElastoPlasticMC")
791 py::class_<TPZMatWithMem<TPZElastoPlasticMem>, TPZMaterial, std::unique_ptr<TPZMatWithMem<TPZElastoPlasticMem>, py::nodelete>>(
m,
"TPZMatWithMem")
796 py::class_<TPZMatElastoPlastic2D < TPZPlasticStepPV<TPZYCMohrCoulombPV, TPZElasticResponse>, TPZElastoPlasticMem >,
TPZMatElastoPlastic< TPZPlasticStepPV<TPZYCMohrCoulombPV, TPZElasticResponse>, TPZElastoPlasticMem >,
TPZMatWithMem<TPZElastoPlasticMem>, TPZMaterial, std::unique_ptr<TPZMatElastoPlastic2D < TPZPlasticStepPV<TPZYCMohrCoulombPV, TPZElasticResponse>, TPZElastoPlasticMem >, py::nodelete>>(
m,
"TPZMatElastoPlastic2DMC")
797 .def(py::init<int, int>())
802 py::class_<TPZElasticResponse>(
m,
"TPZElasticResponse")
807 py::class_<TPZTensor<REAL>>(
m,
"TPZTensor")
812 py::class_<TPZPlasticState<STATE>>(
m,
"TPZPlasticState")
816 py::class_<TPZElastoPlasticMem>(
m,
"TPZElastoPlasticMem")
822 .def(
"SetStress", [](TPZElastoPlasticMem &
self,
TPZTensor<REAL> &stress){
823 self.m_sigma = stress;
827 self.m_elastoplastic_state = plastic_state;
833 py::class_<TPZPlasticCriterion, std::unique_ptr<TPZPlasticCriterion, py::nodelete>>(
m,
"TPZPlasticCriterion")
836 py::class_<TPZYCMohrCoulombPV, TPZPlasticCriterion>(
m,
"TPZYCMohrCoulombPV")
841 py::class_<TPZPlasticStepPV<TPZYCMohrCoulombPV, TPZElasticResponse>, std::unique_ptr<TPZPlasticStepPV<TPZYCMohrCoulombPV, TPZElasticResponse>, py::nodelete>>(
m,
"TPZPlasticStepPVMC")
849 py::class_<TPZMatElasticity2D, TPZMaterial >(
m,
"TPZMatElasticity2D")
850 .def(py::init<int>())
853 py::class_<TPZElasticity3D, TPZMaterial, std::unique_ptr<TPZElasticity3D, py::nodelete>>(
m,
"TPZElasticity3D")
854 .def(py::init<int>())
859 py::class_<TPZCreateApproximationSpace, std::unique_ptr<TPZCreateApproximationSpace, py::nodelete>>(
m,
"TPZCreateApproximationSpace")
866 py::class_<TPZCompMesh , std::unique_ptr<TPZCompMesh, py::nodelete>>(
m,
"TPZCompMesh")
868 .def(py::init<TPZGeoMesh *>())
884 std::ofstream printstream;
885 comp.
Print(printstream);
895 py::enum_<DecomposeType>(
m,
"DecomposeType")
902 py::class_<TPZStructMatrix >(
m,
"TPZStructMatrix")
912 py::class_<TPZFStructMatrix,TPZStructMatrix >(
m,
"TPZFStructMatrix")
914 .def(py::init<TPZCompMesh *>())
918 py::class_<TPZSkylineStructMatrix, TPZStructMatrix >(
m,
"TPZSkylineStructMatrix")
920 .def(py::init<TPZCompMesh *>())
924 py::class_<TPZSkylineNSymStructMatrix, TPZSkylineStructMatrix >(
m,
"TPZSkylineNSymStructMatrix")
925 .def(py::init<TPZCompMesh *>())
929 py::class_<TPZFrontStructMatrix<TPZFrontSym<STATE> >,
TPZStructMatrix>(
m,
"TPZFrontStructMatrix")
930 .def(py::init<TPZCompMesh *>())
934 .def(py::init<TPZCompMesh *>())
938 py::class_<TPZStructMatrixBase >(
m,
"TPZStructMatrixBase")
942 py::class_<TPZSymetricSpStructMatrix, TPZStructMatrix >(
m,
"TPZSymetricSpStructMatrix")
943 .def(py::init<TPZCompMesh *>())
951 py::class_<TPZAnalysis >(
m,
"TPZAnalysis")
953 .def(py::init<TPZCompMesh *, bool>())
969 .def(
"SetStructMatrixDecomposed", [](
TPZAnalysis &
self,
bool key =
true){
970 self.Solver().Matrix()->SetIsDecomposed(key);
984 .def(
"AcceptPseudoTimeStepSolution",[](
TPZAnalysis &
self){
988 std::map<int, TPZMaterial *> &refMatVec = cmesh->
MaterialVec();
989 TPZMatWithMem<TPZElastoPlasticMem> * pMatWithMem;
990 for(
auto mit = refMatVec.begin(); mit != refMatVec.end(); mit++){
991 pMatWithMem =
dynamic_cast<TPZMatWithMem<TPZElastoPlasticMem> *
>(mit->second);
992 if(pMatWithMem != NULL){
997 self.AssembleResidual();
1000 std::map<int, TPZMaterial *> &refMatVec = cmesh->
MaterialVec();
1001 TPZMatWithMem<TPZElastoPlasticMem> * pMatWithMem;
1002 for(
auto mit = refMatVec.begin(); mit != refMatVec.end(); mit++){
1003 pMatWithMem =
dynamic_cast<TPZMatWithMem<TPZElastoPlasticMem> *
>(mit->second);
1004 if(pMatWithMem != NULL){
1013 py::class_<TPZAutoPointer<STATE> >(
m,
"TPZAutoPointer")
1018 py::class_<TPZSolver<STATE> >(
m,
"TPZSolver")
1026 return *(
self.Matrix().operator->());
1037 py::class_<TPZPostProcAnalysis, TPZAnalysis, std::unique_ptr<TPZPostProcAnalysis, py::nodelete> >(
m,
"TPZPostProcAnalysis")
1052 py::class_<TPZVTKGeoMesh, std::unique_ptr<TPZVTKGeoMesh, py::nodelete>>(
m,
"TPZVTKGeoMesh")
1057 py::bind_map<std::map<int, int>>(
m,
"MapIntInt");
1060 py::class_<TPZBuildSBFem, std::unique_ptr<TPZBuildSBFem, py::nodelete>>(
m,
"TPZBuildSBFem")
1061 .def(py::init<
TPZGeoMesh*,
int, std::map<int,int> &>())
1068 m.attr(
"__version__") = VERSION_INFO;
1070 m.attr(
"__version__") =
"dev";
TPZGeoMesh * GeometricGmshMesh4(std::string file_name, TPZGeoMesh *gmesh=NULL)
Convert a Gmsh *.msh file with format 4 to a TPZGeoMesh object.
virtual int64_t SideNodeIndex(int side, int nodenum) const =0
Returns the index of the nodenum node of side.
static void CenterPoint(int side, TPZVec< REAL > ¢er)
Returns the barycentric coordinates in the master element space of the original element.
int64_t NElements() const
Number of computational elements allocated.
Defines the topology of a Pyramid element. Topology Sides 0 to 4 are vertices, sides 5 to 12 are line...
void SetPartitions(TPZVec< int64_t > &gelpartitionids, TPZVec< int64_t > &partition_nodeindices)
define the partition index of each element and the ids of the scaling centers
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=pztopology::gTolerance)
Verifies if the parametric point pt is in the element parametric domain.
static TPZTransform TransformSideToElement(int side)
Returns the transformation which transform a point from the side to the interior of the element...
int AllocateNewElement()
Makes more room for new elements.
static TPZTransform SideToSideTransform(int sidefrom, int sideto)
Returns the transformation which takes a point from the side sidefrom to the side sideto...
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=pztopology::gTolerance)
Verifies if the parametric point pt is in the element parametric domain.
static constexpr REAL RefElVolume()
Volume of the master element (measure)
Contains TPZAnalysis class which implements the sequence of actions to perform a finite element analy...
PYBIND11_MODULE(NEOPZ, m)
static void CenterPoint(int side, TPZVec< REAL > ¢er)
Returns the barycentric coordinates in the master element space of the original element.
void SetAllCreateFunctionsContinuous()
static TPZTransform SideToSideTransform(int sidefrom, int sideto)
Returns the transformation which takes a point from the side sidefrom to the side sideto...
Contains declaration of TPZGeoElSide class which represents an element and its side, and TPZGeoElSideIndex class which represents an TPZGeoElSide index.
static void LowerDimensionSides(int side, TPZStack< int > &smallsides)
Get all sides with lower dimension on side.
static void LowerDimensionSides(int side, TPZStack< int > &smallsides)
Get all sides with lower dimension on side.
virtual void Solve()
Invert the stiffness matrix.
void SetStructuralMatrix(TPZAutoPointer< TPZStructMatrix > strmatrix)
Set structural matrix as auto pointer for analysis.
Implements a vector class which allows to use external storage provided by the user. Utility.
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=pztopology::gTolerance)
Verifies if the parametric point pt is in the element parametric domain.
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=pztopology::gTolerance)
Verifies if the parametric point pt is in the element parametric domain.
static TPZIntPoints * CreateSideIntegrationRule(int side, int order)
Create an integration rule over side.
static TPZTransform TransformSideToElement(int side)
Returns the transformation which transform a point from the side to the interior of the element...
static void CenterPoint(int side, TPZVec< REAL > ¢er)
returns the barycentric coordinates in the master element space of the original element ...
virtual TPZGeoEl * CreateGeoElement(MElementType type, TPZVec< int64_t > &cornerindexes, int matid, int64_t &index, int reftype=1)
Generic method for creating a geometric element. Putting this method centrally facilitates the modifi...
Contains the TPZFrontStructMatrix class which responsible for a interface among Finite Element Packag...
static int NumSides()
Returns the number of connects for a set dimension.
static TPZTransform SideToSideTransform(int sidefrom, int sideto)
Returns the transformation which takes a point from the side sidefrom to the side sideto...
static void LowerDimensionSides(int side, TPZStack< int > &smallsides)
Get all sides with lower dimension on side.
static int SideNodeLocId(int side, int node)
Returns the local node number of the node "node" along side "side".
int64_t NEquations()
This computes the number of equations associated with non-restrained nodes.
static constexpr REAL RefElVolume()
Volume of the master element.
static TPZTransform TransformElementToSide(int side)
Returns the transformation which projects a point from the interior of the element to the side...
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=pztopology::gTolerance)
Verifies if the parametric point pt is in the element parametric domain.
static int SideDimension(int side)
Returns the dimension of the side.
static void LowerDimensionSides(int side, TPZStack< int > &smallsides)
Get all sides with lower dimension on side.
TPZGeoMesh * GeometricGmshMesh3(std::string file_name, TPZGeoMesh *gmesh=NULL)
Convert a Gmsh *.msh file with format 3 to a TPZGeoMesh object.
Defines the topology of a triangle element. Topology Sides 0 to 2 are vertices, sides 3 to 5 are line...
Contains the TPZQuadraticQuad class which defines a quadrilateral geometric element with quadratic ma...
static int SideDimension(int side)
Returns the dimension of the side.
Defines step solvers class. Solver.
void SetSolver(TPZMatrixSolver< STATE > &solver)
Set solver matrix.
static constexpr REAL RefElVolume()
Volume of the master element (measure)
static int NSideNodes(int side)
Returns the number of nodes (not connectivities) associated with a side.
virtual TPZMatrix< STATE > * SetupMatrixData(TPZStack< int64_t > &elgraph, TPZVec< int64_t > &elgraphindex)
static TPZIntPoints * CreateSideIntegrationRule(int side, int order)
Create an integration rule over side.
Defines the topology of a point. Topology It has a one side (the same element).
Contains the TPZPoint class which defines the topology of a point.
static TPZTransform TransformElementToSide(int side)
Returns the transformation which transform a point from the interior of the element to the side...
static void HigherDimensionSides(int side, TPZStack< int > &high)
Returns all sides whose closure contains side.
virtual void Assemble()
Assemble the stiffness matrix and load vector.
TPZCompMesh * Mesh() const
Returns the pointer to the computational mesh.
int64_t NElements() const
Number of elements of the mesh.
static TPZIntPoints * CreateSideIntegrationRule(int side, int order)
Create an integration rule over side.
static void LowerDimensionSides(int side, TPZStack< int > &smallsides)
Get all sides with lower dimension on side.
static TPZTransform TransformElementToSide(int side)
Returns the transformation which transform a point from the interior of the element to the side...
static TPZIntPoints * CreateSideIntegrationRule(int side, int order)
Create an integration rule over side.
static void HigherDimensionSides(int side, TPZStack< int > &high)
Returns all sides whose closure contains side.
Contains declaration of TPZGeoElBC class, it is a structure to help the construction of geometric ele...
static int NSideNodes(int side)
return the number of vertices (not connectivities) associated with a side
size_t NMaterials() const
Number of materials.
This class implements a simple vector storage scheme for a templated class T. Utility.
virtual void DefineGraphMesh(int dimension, const TPZVec< std::string > &scalnames, const TPZVec< std::string > &vecnames, const std::string &plotfile)
Define GrapMesh as V3D, DX, MV or VTK depending on extension of the file.
int64_t NElements() const
Access method to query the number of elements of the vector.
Implements a chunk vector with free store administration. Utility.
static int SideDimension(int side)
Returns the dimension of the side.
TPZGeoElSide Neighbour() const
virtual int NSides() const =0
Returns the number of connectivities of the element.
Contains the TPZStructMatrixOR class which responsible for a interface among Matrix and Finite Elemen...
Contains the TPZSymetricSpStructMatrix class which implements sparse structural matrices.
virtual int SideDimension(int side) const =0
Return the dimension of side.
static TPZTransform SideToSideTransform(int sidefrom, int sideto)
returns the transformation which takes a point from the side sidefrom to the side sideto ...
void SetDimension(int dim)
Set Dimension.
static TPZTransform TransformElementToSide(int side)
Returns the transformation which projects a point from the interior of the element to the side...
void SetPostProcessVariables(TPZVec< int > &matIds, TPZVec< std::string > &varNames)
Contains the TPZMatPoisson3d class.
Implements an abstract class implementing the memory features.
Contains the TPZTriangle class which defines the topology of a triangle.
static int NumSides()
Returns the number of connects of the element (21)
static int SideNodeLocId(int side, int node)
Returns the local node number of the node "node" along side "side".
Contains the TPZTetrahedron class which defines the topology of the tetrahedron element.
Contains the TPZElasticity3D class which implements a 3D isotropic elasticity material.
TPZSkylMatrix< REAL > matrix
Contains the TPZFStructMatrix class which implements Full Structural Matrices.
void SetDefaultOrder(int order)
void BuildComputationalMeshFromSkeleton(TPZCompMesh &cmesh)
build the computational elements of the skeleton and build the volume elements directly from the skel...
static int NumSides()
Number of connects of the element (27)
TPZFMatrix< STATE > & Solution()
Returns the solution matrix.
Refines geometrical mesh (all the elements) num times.
This abstract class defines the behaviour which each derived class needs to implement.
static void HigherDimensionSides(int side, TPZStack< int > &high)
Returns all sides whose closure contains side.
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
static void HigherDimensionSides(int side, TPZStack< int > &high)
Returns all sides whose closure contains side.
int64_t size() const
Returns the number of elements of the vector.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object reallocating the necessary storage, copying the existing objects to the new...
Defines the topology of the hexahedron element. Topology Sides 0 to 7 are vertices, sides 8 to 19 are lines, 20 to 25 are quadrilaterals and side 26 is the hexahedra (cube).
void Resize(const int newsize)
Increase the size of the chunk vector.
static int NumSides()
Returns number of connects of the element ???
TPZCreateApproximationSpace & ApproxSpace()
Contains declaration of TPZMesh class which defines a geometrical mesh and contains a corresponding l...
static TPZTransform SideToSideTransform(int sidefrom, int sideto)
Returns the transformation which takes a point from the side sidefrom to the side sideto...
static int SideNodeLocId(int side, int node)
Returns the local node number of the node "node" along side "side".
Implements the sequence of actions to perform a finite element analysis. Analysis.
static int NSideNodes(int side)
Returns the number of nodes (not connectivities) associated with a side.
static TPZTransform TransformSideToElement(int side)
Returns the transformation which transform a point from the side to the interior of the element...
static TPZTransform TransformElementToSide(int side)
Returns the transformation which transform a point from the interior of the element to the side...
static TPZTransform SideToSideTransform(int sidefrom, int sideto)
Returns the transformation which takes a point from the side sidefrom to the side sideto...
virtual void LoadSolution()
Load the solution into the computable grid.
virtual void Print(std::ostream &out=std::cout) const
Print the information of the grid to an ostream.
Implements a generic geometric element which is refined according to a generic refinement pattern...
static constexpr REAL RefElVolume()
Volume of the master element (measure of the element)
TPZGeoEl * Element(int64_t iel)
static int SideDimension(int side)
Returns the dimension of the side.
TVar Norm(const TPZFMatrix< TVar > &A)
Returns the norm of the matrix A.
static int SideDimension(int side)
Returns the dimension of the side.
Contains TPZMatrixclass which implements full matrix (using column major representation).
#define DebugStop()
Returns a message to user put a breakpoint in.
int64_t NNodes() const
Number of nodes of the mesh.
virtual void SetNumThreads(int n)
YC_t fYC
Object which represents the yield criterium.
void SetAllCreateFunctionsContinuousWithMem()
static void LowerDimensionSides(int side, TPZStack< int > &smallsides)
Get all sides with lower dimension on side.
This class defines the boundary condition for TPZMaterial objects.
Contains the TPZSkylineStructMatrix class which implements SkyLine Structural Matrices.
virtual void SetUpdateMem(bool update=1)
Sets/Unsets the internal memory data to be updated in the next assemble/contribute call...
static void HigherDimensionSides(int side, TPZStack< int > &high)
Returns all sides whose closure contains side.
Free store vector implementation.
static TPZTransform TransformSideToElement(int side)
Returns the transformation which transform a point from the side to the interior of the element...
Contains the TPZQuadrilateral class which defines the topology of a quadrilateral element...
static int SideDimension(int side)
Returns the dimension of the side.
static int SideDimension(int side)
Returns the dimension of the side.
TPZMaterial * FindMaterial(int id)
Find the material with identity id.
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
virtual void AutoBuild(const std::set< int > *MaterialIDs)
Creates the computational elements, and the degree of freedom nodes.
int64_t Rows() const
Returns number of rows.
static int NSideNodes(int side)
Returns the number of nodes (not connectivities) associated with a side.
static constexpr REAL RefElVolume()
Volume of the master element (measure)
Contains declaration of TPZGeoElRefPattern class which implements a generic geometric element which i...
Defines the topology of a Prism. Topology Sides 0 to 7 are vertices, sides 7 to 14 are lines...
static TPZTransform TransformElementToSide(int side)
Responsible for a interface among Finite Element Package and Matrices package to frontal method...
Contains declaration of the TPZAutoPointer class which has Increment and Decrement actions are mutexe...
static TPZIntPoints * CreateSideIntegrationRule(int side, int order)
Create an integration rule over side.
static void CenterPoint(int side, TPZVec< REAL > ¢er)
Returns the barycentric coordinates in the master element space of the original element.
virtual TPZGeoElSide Neighbour(int side)=0
Returns a pointer to the neighbour and the neighbourside along side of the current element...
Defines the topology of a line element. Topology Sides 0 and 1 are vertices, side 2 is the line...
static void PrintGMeshVTK(TPZGeoMesh *gmesh, std::ofstream &file, bool matColor=true)
Default constructor for graphical mesh with VTK format.
static TPZTransform TransformSideToElement(int side)
Returns the transformation which transform a point from the side to the interior of the element...
static void CenterPoint(int side, TPZVec< REAL > ¢er)
Returns the barycentric coordinates in the master element space of the original element.
Contains declaration of TPZCompMesh class which is a repository for computational elements...
Full matrix class. Matrix.
virtual void PostProcess(int resolution)
Draw solution over mesh for all dimensions.
static void HigherDimensionSides(int side, TPZStack< int > &high)
Returns all sides whose closure contains side.
static void LowerDimensionSides(int side, TPZStack< int > &smallsides)
Get all sides with lower dimension on side.
static TPZIntPoints * CreateSideIntegrationRule(int side, int order)
Create an integration rule over side.
static TPZTransform TransformSideToElement(int side)
Returns the transformation which transform a point from the side to the interior of the element...
Contains the TPZPyramid class which defines the topology of a pyramid element.
void SetDimModel(int dim)
Set de dimension of the domain of the problem.
virtual int NSideNodes(int side) const =0
Returns the number of nodes for a particular side.
static int NSideNodes(int side)
Returns the number of nodes (not connectivities) associated with a side.
std::map< int,TPZMaterial *> & MaterialVec()
Returns a reference to the material pointers vector.
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=pztopology::gTolerance)
Verifies if the parametric point pt is in the element parametric domain.
Contains TPZMatrix<TVar>class, root matrix class.
static void CenterPoint(int side, TPZVec< REAL > ¢er)
Returns the barycentric coordinates in the master element space of the original element.
static int SideNodeLocId(int side, int node)
Returns the local node number of the node "node" along side "side".
static int NumSides()
Returns number of connects of the element (27) ???
void BuildConnectivity()
Build the connectivity of the grid.
virtual TPZBndCond * CreateBC(TPZMaterial *reference, int id, int typ, TPZFMatrix< STATE > &val1, TPZFMatrix< STATE > &val2)
Creates an object TPZBndCond derived of TPZMaterial.
int InsertMaterialObject(TPZMaterial *mat)
Insert a material object in the datastructure.
Defines the topology of the tetrahedron element. Topology Sides 0 to 3 are vertices, sides 4 to 9 are lines, sides 10 to 13 are triangles and side 14 is the tetrahedra.
virtual int Dimension() const =0
Returns the dimension of the element.
void SetMaterialDataHook(REAL Ela, REAL poisson)
static int NumSides()
Returns number of sides of the element (9)
int Dimension()
Get Dimension.
virtual void AssembleResidual()
Assemble the load vector.
static TPZTransform SideToSideTransform(int sidefrom, int sideto)
Returns the transformation which takes a point from the side sidefrom to the side sideto...
This class implements a geometric mesh for the pz environment. Geometry.
MElementType
Define the element types.
void SetEngineeringData(REAL Eyoung, REAL Poisson)
This class implements a stack object. Utility.
static TPZIntPoints * CreateSideIntegrationRule(int side, int order)
Create an integration rule over side.
static int NSideNodes(int side)
Returns the number of nodes (not connectivities) associated with a side.
static int NSideNodes(int side)
Returns the number of nodes (not connectivities) associated with a side.
string to_string(const string &value)
static TPZTransform TransformElementToSide(int side)
Returns the transformation which projects a point from the interior of the element to the side...
Implements computational mesh. Computational Mesh.
Contains TPZSolver class which defines a abstract class of solvers which will be used by matrix class...
static void CenterPoint(int side, TPZVec< REAL > ¢er)
Returns the barycentric coordinates in the master element space of the original element.
Classe que efetua avanco de um passo de plastificacao utilizando o metodo de Newton.
static int NSideNodes(int side)
Returns the number of nodes (not connectivities) associated with a side.
Defines the topology of a quadrilateral element. Topology Sides 0 to 3 are vertices, sides 4 to 7 are lines, side 8 is the quadrilateral.
static int NumSides()
Returns the number of connects of the element (7)
static TPZTransform TransformElementToSide(int side)
Returns the transformation which projects a point from the interior of the element to the side...
static constexpr REAL RefElVolume()
Volume of the master element.
Contains TPZStepSolver class which defines step solvers class.
int64_t Cols() const
Returns number of cols.
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=pztopology::gTolerance)
Verifies if the parametric point pt is in the element parametric domain.
virtual void Print(std::ostream &out) const
void CreateWithMemory(bool flag)
static int SideDimension(int side)
returns the dimension of the side
static TPZTransform TransformSideToElement(int side)
Returns the transformation which transform a point from the side to the interior of the element...
TPZPlasticState< STATE > fN
Plastic State Variables (EpsT, EpsP, Alpha) at the current time step.
static int NumSides()
Number of connects of the element (21)
static int SideNodeLocId(int side, int node)
Returns the local node number of the node "node" along side "side".
static TPZTransform TransformSideToElement(int side)
Returns the transformation which transform a point from the side to the interior of the element...
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=1e-6)
Verifies if the parametric point pt is in the element parametric domain.
TPZFMatrix< STATE > & Rhs()
Returns the load vector.
Contains the TPZCube class which defines the topology of the hexahedron element.
clarg::argString m("-m", "input matrix file name (text format)", "matrix.txt")
void GetCoordinates(TPZVec< REAL > &co)
Fill the coordinates of the node.
Contains the TPZLine class which defines the topology of a line element.
void SetCompMesh(TPZCompMesh *pRef, bool mustOptimizeBandwidth=false) override
Set the computational mesh we are going to post process.
static int SideNodeLocId(int side, int node)
Returns the local node number of the node "node" along side "side".
static int SideNodeLocId(int side, int node)
returns the local node number of the node "node" along side "side"
Contains the TPZPrism class which defines the topology of a Prism.
Contains the TPZVTKGeoMesh class which implements the graphical mesh to VTK environment to geometric ...
static void LowerDimensionSides(int side, TPZStack< int > &smallsides)
Get all sides with lower dimension on side.
static int SideNodeLocId(int side, int node)
Returns the local node number of the node "node" along side "side".
Implements Sparse Structural Matrices. Structural Matrix.
const TVar & GetVal(const int64_t row, const int64_t col) const override
Get values without bounds checking This method is faster than "Get" if DEBUG is defined.
static constexpr REAL RefElVolume()
Volume of the master element.
TPZFMatrix< STATE > & Solution()
Access the solution vector.
void SetUp(REAL Phi, REAL Psi, REAL c, TPZElasticResponse &ER)
Sets up the data.
Contains the TPZParFrontStructMatrix class which is a structural matrix with parallel techniques incl...
static constexpr REAL RefElVolume()
Volume of the master element (measure of the element)
static void CenterPoint(int side, TPZVec< REAL > ¢er)
Returns the barycentric coordinates in the master element space of the original element.
virtual void Print(std::ostream &out=std::cout) const
Prints mesh data.
static TPZTransform SideToSideTransform(int sidefrom, int sideto)
Returns the transformation which takes a point from the side sidefrom of the side sideto...
static TPZIntPoints * CreateSideIntegrationRule(int side, int order)
Create an integration rule over side.
Root matrix class (abstract). Matrix.
static void HigherDimensionSides(int side, TPZStack< int > &high)
Returns all sides whose closure contains side.
static void HigherDimensionSides(int side, TPZStack< int > &high)
returns all sides whose closure contains side